:root {
  color-scheme: dark;
  --bg: #0b0f15;
  --panel: #080c12;
  --panel-2: #0f141d;
  --line: #1b2430;
  --line-soft: #151d27;
  --text: #eef4ff;
  --muted: #8d98a8;
  --muted-2: #687383;
  --green: #27c95a;
  --green-soft: rgba(39, 201, 90, 0.14);
  --yellow: #f2b51d;
  --yellow-soft: rgba(242, 181, 29, 0.14);
  --red: #ff534d;
  --red-soft: rgba(255, 83, 77, 0.15);
  --blue: #3885ff;
  --blue-soft: rgba(56, 133, 255, 0.16);
  --brown-soft: rgba(154, 95, 31, 0.16);
  --row-height: 43px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 980px;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

button,
select {
  font: inherit;
}

.status-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 13px 24px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup,
.title-row,
.toolbar,
.legend-row,
.panel-heading,
.bank-cell,
.metric-card,
.live-pill {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 16px;
}

.logo-mark {
  width: 68px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f6f8f4;
  color: #758443;
  font-size: 15px;
  font-style: italic;
  font-weight: 900;
  border: 1px solid #dde3d2;
  transform: skew(-8deg);
}

.title-row {
  gap: 10px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 19px;
  line-height: 1.1;
}

h2 {
  font-size: 13px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.live-pill {
  gap: 6px;
  height: 18px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.live-pill span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 201, 90, 0.11);
}

.toolbar,
.toolbar-stack {
  gap: 10px;
}

.toolbar-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.powered-by {
  color: #7e8998;
  font-size: 11px;
  font-weight: 700;
}

.cbn-mark {
  width: 42px;
  height: 46px;
  background: transparent;
  border: 0;
  font-style: normal;
  transform: none;
}

.cbn-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.select-control {
  height: 32px;
  border: 1px solid #2a3443;
  border-radius: 6px;
  background: #151b25;
  color: #cdd6e4;
}

.select-control {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
}

.select-control select {
  min-width: 122px;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  font-weight: 700;
  font-size: 12px;
}

.icon {
  color: var(--muted);
  font-size: 14px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 0;
}

.metric-card {
  min-height: 76px;
  gap: 15px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.metric-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-size: 18px;
  color: var(--blue);
  background: var(--blue-soft);
}

.metric-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

.metric-icon.yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
}

.metric-label,
.table-header {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 3px;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.metric-value.green {
  color: var(--green);
}

.metric-value.yellow {
  color: var(--yellow);
}

.metric-value.blue {
  color: #55a0ff;
}

.metric-subtitle {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.anomaly-panel {
  padding: 15px 16px 13px;
}

.panel-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.panel-heading.tight {
  min-height: 44px;
  margin: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.warning-icon,
.pulse-line {
  color: var(--yellow);
  margin-right: 7px;
}

.pulse-line {
  color: var(--green);
}

.count-pill,
.section-tag {
  padding: 4px 9px;
  border-radius: 9px;
  background: #151a22;
  border: 1px solid #242d3a;
  color: #a8b2c0;
  font-size: 11px;
  font-weight: 700;
}

.count-pill {
  color: #c5a76b;
  background: var(--brown-soft);
  border-color: #3b2a19;
}

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

.anomaly-card {
  position: relative;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 34px 10px 14px;
  border-radius: 6px;
  overflow: hidden;
  background: #1b1214;
  border: 1px solid #3f1d22;
  color: inherit;
  text-decoration: none;
}

.anomaly-card.warning {
  background: #1d1710;
  border-color: #3a2911;
}

.anomaly-card:hover,
.clickable-row:hover {
  background-color: #101722;
}

.anomaly-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--red);
}

.anomaly-card.warning::before {
  background: var(--yellow);
}

.avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  font-size: 10px;
  font-weight: 900;
}

.anomaly-card strong,
.bank-cell strong {
  display: block;
  color: #f7faff;
  font-size: 12px;
  line-height: 1.1;
}

.anomaly-card span.reason {
  display: block;
  margin-top: 4px;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
}

.anomaly-card.warning span.reason {
  color: var(--yellow);
}

.chevron {
  position: absolute;
  right: 15px;
  color: #8d98a8;
}

.legend-row {
  min-height: 34px;
  gap: 24px;
  margin: 14px 0;
  padding: 0 18px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color: #aab4c2;
  font-size: 11px;
}

.dot {
  display: inline-block;
  width: 11px;
  height: 8px;
  margin-right: 7px;
  border-radius: 999px;
}

.success {
  background: var(--green);
}

.warning {
  background: var(--yellow);
}

.failure {
  background: var(--red);
}

.nodata {
  background: #333c49;
}

.granularity {
  margin-left: auto;
  color: var(--muted);
}

.monitor-panel {
  margin-top: 14px;
  overflow: hidden;
}

.status-table {
  width: 100%;
}

.table-grid {
  display: grid;
  grid-template-columns: 178px 112px 116px 100px 100px minmax(430px, 1fr);
}

.table-header,
.table-row > div {
  padding: 0 18px;
}

.table-header {
  min-height: 38px;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.table-row {
  min-height: var(--row-height);
  align-items: center;
  border-bottom: 1px solid rgba(27, 36, 48, 0.68);
}

.clickable-row {
  cursor: pointer;
}

.table-row:last-child {
  border-bottom: 0;
}

.bank-cell {
  gap: 9px;
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.health-dot.warning {
  background: var(--yellow);
}

.health-dot.failure {
  background: var(--red);
}

.bank-text small {
  display: block;
  color: #9aa5b4;
  font-size: 10px;
  margin-top: 2px;
}

.number-cell {
  color: #dce5f4;
  font-size: 11px;
  font-weight: 800;
}

.rate-good {
  color: var(--green);
}

.rate-warn {
  color: var(--yellow);
}

.rate-bad {
  color: var(--red);
}

.timeline-wrap {
  padding-left: 7px;
  padding-right: 24px;
}

.time-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin: -2px 0 4px;
  color: #697484;
  font-size: 8px;
}

.time-labels span:last-child {
  text-align: right;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(60, 1fr);
  gap: 3px;
  height: 18px;
  align-items: end;
}

.bar {
  min-width: 3px;
  height: 17px;
  border-radius: 2px;
  background: var(--green);
}

.bar.warning {
  background: var(--yellow);
}

.bar.failure {
  background: var(--red);
}

.bar.nodata {
  background: #232a34;
}

.collapsed-row {
  color: var(--muted);
  font-size: 11px;
}

.expand-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.expand-button:hover {
  color: #d6deeb;
}

.expand-button span {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #364152;
  background: transparent;
  color: #768293;
  font-size: 12px;
}

.back-link,
.text-link {
  color: #8bb8ff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover,
.text-link:hover {
  color: #c7ddff;
}

.detail-shell {
  max-width: 1120px;
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 16px;
  padding: 18px 0 0;
}

.detail-heading > div {
  margin-right: auto;
}

.detail-heading h2 {
  color: var(--text);
  font-size: 18px;
}

.badge-failure {
  color: #ffb0ad;
  background: var(--red-soft);
  border-color: #4a2022;
}

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

.detail-metric {
  min-height: 76px;
  padding: 15px 16px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.detail-metric div {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-metric strong {
  display: block;
  margin-top: 9px;
  color: #eef4ff;
  font-size: 18px;
}

.detail-panel {
  margin-top: 0;
  overflow: hidden;
}

.detail-content {
  padding: 18px;
}

.mini-timeline {
  display: grid;
  grid-template-columns: repeat(60, minmax(3px, 1fr));
  gap: 4px;
  min-height: 34px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.mini-timeline span {
  height: 28px;
  border-radius: 3px;
  background: var(--green);
}

.mini-timeline span.warning {
  background: var(--yellow);
}

.mini-timeline span.failure {
  background: var(--red);
}

.mini-timeline span.nodata {
  background: #232a34;
}

.event-list {
  display: grid;
  gap: 11px;
  padding-top: 16px;
}

.event-list div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  color: #b8c2d0;
  font-size: 12px;
}

.event-list strong {
  color: #eef4ff;
}

.has-tooltip {
  position: relative;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid #2c3848;
  border-radius: 6px;
  background: #111823;
  color: #e8eef8;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
  text-transform: none;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: normal;
}

.has-tooltip:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 1080px) {
  .status-shell {
    padding-inline: 16px;
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

/* ── NIBSS Public Systems Status groups ─────────────────────────────────── */
.group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  user-select: none;
  background: var(--panel-2);
  transition: background 120ms ease;
}

.group-header:hover {
  background: #101722;
}

.group-chevron {
  color: var(--muted);
  font-size: 13px;
  width: 14px;
  flex-shrink: 0;
}

.group-chevron-right {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.group-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.group-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.group-badge-ok {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid rgba(39, 201, 90, 0.25);
}

.group-badge-warn {
  color: var(--yellow);
  background: var(--yellow-soft);
  border: 1px solid rgba(242, 181, 29, 0.25);
}

.group-badge-fail {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgba(255, 83, 77, 0.25);
}

.group-body {
  border-bottom: 2px solid var(--line);
}

.group-table-header {
  background: var(--panel);
  padding-left: 18px;
}
