/* /Pages/EnvironmentStatus.razor.rz.scp.css */
/* ═══ Container ═══ */
.health-status-container[b-e39x6y5vsq] {
  display: flex;
  flex-direction: column;
}

/* ═══ Navigation zone (EnvironmentTabs) ═══ */
.nav-zone[b-e39x6y5vsq] {
  border-bottom: 2px solid rgba(128, 128, 128, 0.20);
  margin-bottom: 12px;
}

/* ═══ Content zone ═══ */
.content-zone[b-e39x6y5vsq] {
  display: flex;
  flex-direction: column;
}

/* ═══ Status header ═══ */
.status-header[b-e39x6y5vsq] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.status-header-actions[b-e39x6y5vsq] {
  display: flex;
  align-items: center;
  gap: 4px;
}

.last-updated-label[b-e39x6y5vsq] { opacity: 0.6; }

/* ═══ Table card (MudPaper) — no overflow constraint ═══ */
.table-card[b-e39x6y5vsq] {
  border-radius: 6px;
}

/* ═══ Constrain the matrix table height for this page context ═══ */
[b-e39x6y5vsq] .health-table-wrapper {
  max-height: calc(100vh - 260px);
}
/* /Pages/GlobalStatus.razor.rz.scp.css */
/* ═══ Timing panel ═══ */
.timing-panel[b-ocfsknzh58] {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  opacity: 0.7;
}

.timing-label[b-ocfsknzh58] { margin-right: 4px; }
.timing-chip[b-ocfsknzh58]  { font-size: 0.7rem; }

/* ═══ Status header ═══ */
.status-header[b-ocfsknzh58] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.status-header-actions[b-ocfsknzh58] {
  display: flex;
  align-items: center;
  gap: 4px;
}

.last-updated-label[b-ocfsknzh58] { opacity: 0.6; }

/* ═══ Container ═══ */
.health-status-container[b-ocfsknzh58] {
  display: flex;
  flex-direction: column;
}

/* ═══ KPI Cards ═══ */
[b-ocfsknzh58] .kpi-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

[b-ocfsknzh58] .kpi-groups {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 4px;
}

[b-ocfsknzh58] .kpi-group {
  flex: 1 1 320px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 8px 8px 2px 8px;
  background-color: rgba(0, 0, 0, 0.015);
}

[b-ocfsknzh58] .kpi-group--health {
  margin-left: 0;
}

[b-ocfsknzh58] .kpi-group-slot--health {
  margin-left: 0;
}

[b-ocfsknzh58] .kpi-group--ops {
  background-color: rgba(2, 136, 209, 0.04);
}

[b-ocfsknzh58] .kpi-group-title {
  display: block;
  margin: 0 0 6px 2px;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.8;
}

[b-ocfsknzh58] .kpi-card {
  padding: 8px 12px;
  min-width: 100px;
  text-align: center;
  background-color: var(--mud-palette-surface, #fff);
  border-top: 3px solid var(--mud-palette-lines-default, #e0e0e0);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.12);
}

[b-ocfsknzh58] .kpi-card--critical {
  border-top-color: var(--pc-kpi-critical-border, var(--mud-palette-error, #d32f2f));
  background-color: var(--pc-kpi-critical-bg, rgba(211, 47, 47, 0.08));
}

[b-ocfsknzh58] .kpi-card--attention {
  border-top-color: var(--pc-kpi-attention-border, var(--mud-palette-warning, #ed6c02));
  background-color: var(--pc-kpi-attention-bg, rgba(237, 108, 2, 0.1));
}

[b-ocfsknzh58] .kpi-card--neutral {
  border-top-color: var(--pc-kpi-neutral-border, var(--mud-palette-info, #0288d1));
  background-color: var(--pc-kpi-neutral-bg, rgba(2, 136, 209, 0.08));
}

[b-ocfsknzh58] .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

[b-ocfsknzh58] .kpi-icon {
  opacity: 0.85;
  margin-bottom: 2px;
}

[b-ocfsknzh58] .kpi-unit {
  font-size: 0.75rem;
  font-weight: 400;
  margin-left: 1px;
}

[b-ocfsknzh58] .kpi-label {
  font-size: 0.7rem;
  opacity: 0.7;
  white-space: nowrap;
}

/* ═══ Filter controls ═══ */
[b-ocfsknzh58] .health-filters {
  padding: 6px 8px;
  background-color: rgba(0, 0, 0, 0.015);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  margin-bottom: 6px;
}

[b-ocfsknzh58] .filter-label {
  opacity: 0.7;
}

[b-ocfsknzh58] .affected-toggle {
  margin-left: 8px;
}

[b-ocfsknzh58] .filter-help {
  display: block;
  margin-bottom: 6px;
  opacity: 0.75;
}

[b-ocfsknzh58] .refreshing-label {
  display: block;
  margin-bottom: 4px;
  opacity: 0.7;
}

/* ═══ Constrain the matrix table height for this page context ═══
   MudTabPanel receives Style="overflow: visible" in Razor so it never clips. */
[b-ocfsknzh58] .health-table-wrapper {
  max-height: calc(100vh - 30px);
}
/* /Shared/ServiceHealthMatrix.razor.rz.scp.css */
/* ═══ Table wrapper ═══ */
.health-table-wrapper[b-sh2gg1cruv] {
  overflow: auto;
  /* max-height is intentionally omitted here so each page can set it via ::deep */
}

/* ═══ Table — fixed layout, must use SEPARATE borders for sticky-td to work ═══
   border-collapse:collapse is a known Chromium bug with position:sticky on <td> */
.health-table[b-sh2gg1cruv] {
  --region-header-height: 34px;
  --system-header-height: 110px;
  table-layout: fixed;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.health-table.has-compact-regions[b-sh2gg1cruv] {
  --region-header-height: 48px;
}

.health-table col.service-col[b-sh2gg1cruv] {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}

.health-table col.data-col[b-sh2gg1cruv] {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
}

.health-table col.filler-col[b-sh2gg1cruv] {
  width: auto;
}

/* ───────────────────────── HEADER ROW 1 — regions ───────────────────────── */
.health-table thead tr:first-child th.region-header[b-sh2gg1cruv] {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  height: var(--region-header-height);
  padding: 4px 10px;
  color: inherit;          /* adapts to dark mode */
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.health-table thead tr:first-child th.region-header .region-label[b-sh2gg1cruv] {
  display: block;
  overflow: hidden;
  white-space: inherit;
  text-overflow: inherit;
}

.health-table thead tr:first-child th.region-header.region-header-compact[b-sh2gg1cruv] {
  padding: 4px 6px;
  white-space: normal;
  text-overflow: clip;
}

.health-table thead tr:first-child th.region-header.region-header-compact .region-label[b-sh2gg1cruv] {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

/* Top-left corner — sticky on both axes, same height as region row */
.health-table thead tr:first-child th.service-col-header[b-sh2gg1cruv] {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(128, 128, 128, 0.12), rgba(128, 128, 128, 0.12));
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  height: var(--region-header-height);
  padding: 4px 12px;
  color: inherit;
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
  border-right: 3px solid rgba(128, 128, 128, 0.30);
  text-align: left;
}

/* ───────────────────────── HEADER ROW 2 — systems (VERTICAL TEXT) ───────── */
.health-table thead tr:nth-child(2) th.system-header[b-sh2gg1cruv] {
  position: sticky;
  top: var(--region-header-height);
  z-index: 2;
  height: var(--system-header-height);
  padding: 0;
  color: inherit;
  border-bottom: 2px solid rgba(128, 128, 128, 0.30);
  font-size: 0.72rem;
  font-weight: 600;
  overflow: hidden;
}

.health-table thead tr:nth-child(2) th.system-header .system-label[b-sh2gg1cruv] {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 8px 0;
  box-sizing: border-box;
  /* write text bottom-to-top without rotating the cell border box */
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  text-align: center;
}

.health-table thead th.filler-header[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
}

.health-table thead th.filler-header-top[b-sh2gg1cruv] {
  position: sticky;
  top: 0;
  z-index: 1;
  height: var(--region-header-height);
  padding: 0;
  border-bottom: 1px solid rgba(128, 128, 128, 0.25);
}

.health-table thead th.filler-header-bottom[b-sh2gg1cruv] {
  position: sticky;
  top: var(--region-header-height);
  z-index: 1;
  height: var(--system-header-height);
  padding: 0;
  border-bottom: 2px solid rgba(128, 128, 128, 0.30);
}

/* ───────────────────────── SEMANTIC STATE CLASSES — region headers ───────── */
.health-table thead tr:first-child th.region-header--unhealthy[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(244, 67, 54, 0.20), rgba(244, 67, 54, 0.20));
}

.health-table thead tr:first-child th.region-header--degraded[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(255, 152, 0, 0.20), rgba(255, 152, 0, 0.20));
}

.health-table thead tr:first-child th.region-header--rollout[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(33, 150, 243, 0.20), rgba(33, 150, 243, 0.20));
}

.health-table thead tr:first-child th.region-header--healthy[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.07));
}

/* ───────────────────────── SYSTEM HEADER LINKS ─────────────────────────── */
.health-table thead tr:nth-child(2) th.system-header .system-link[b-sh2gg1cruv] {
  text-decoration: none;
  color: var(--mud-palette-primary-lighten, #594ae2);
}

.health-table thead tr:nth-child(2) th.system-header .system-link:hover[b-sh2gg1cruv] {
  text-decoration: underline;
  background-color: rgba(0, 0, 0, 0.04);
}

/* ───────────────────────── SEMANTIC STATE CLASSES — system headers ──────── */
.health-table thead tr:nth-child(2) th.system-header--unhealthy[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(244, 67, 54, 0.10), rgba(244, 67, 54, 0.10));
}

.health-table thead tr:nth-child(2) th.system-header--degraded[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(255, 152, 0, 0.10), rgba(255, 152, 0, 0.10));
}

.health-table thead tr:nth-child(2) th.system-header--rollout[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(33, 150, 243, 0.10), rgba(33, 150, 243, 0.10));
}

.health-table thead tr:nth-child(2) th.system-header--healthy[b-sh2gg1cruv] {
  background-color: var(--mud-palette-surface, #fff);
  background-image: linear-gradient(rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.03));
}

/* ───────────────────────── REGION BOUNDARY LINES ────────────────────────── */
/* Left wall of each non-first region */
.health-table thead tr:first-child th.region-boundary[b-sh2gg1cruv],
.health-table tbody td.region-boundary[b-sh2gg1cruv] {
  border-left: 3px solid rgba(128, 128, 128, 0.45) !important;
}

/* Right wall of each non-last region */
.health-table thead tr:first-child th.region-right-boundary[b-sh2gg1cruv],
.health-table tbody td.region-right-boundary[b-sh2gg1cruv] {
  border-right: 3px solid rgba(128, 128, 128, 0.45) !important;
}

/* System headers use regular left/right borders because only inner text is rotated */
.health-table thead tr:nth-child(2) th.region-boundary[b-sh2gg1cruv] {
  border-left: 3px solid rgba(128, 128, 128, 0.45) !important;
}

.health-table thead tr:nth-child(2) th.region-right-boundary[b-sh2gg1cruv] {
  border-right: 3px solid rgba(128, 128, 128, 0.45) !important;
}

/* ───────────────────────── SERVICE NAME COLUMN ──────────────────────────── */
/* Fully opaque surface so scrolled data cells are hidden behind it */
.health-table tbody td.service-name[b-sh2gg1cruv] {
  position: sticky;
  left: 0;
  z-index: 1;
  font-weight: 600;
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 12px;
  border-right: 3px solid rgba(128, 128, 128, 0.30);
  /* Solid opaque background — must NOT be transparent or sticky occlusion fails */
  background-color: var(--mud-palette-surface, #fff);
  height: 36px;
  vertical-align: middle;
}

/* ───────────────────────── ROW HOVER ────────────────────────────────────── */
/* Use a dedicated background rule; data cells get a transparent tint,
   service-name cell gets an opaque override so it stays solid */
.health-table tbody tr:hover td.data-cell[b-sh2gg1cruv] {
  background-color: rgba(128, 128, 128, 0.08);
  transition: background-color 100ms ease;
}

.health-table tbody tr:hover td.service-name[b-sh2gg1cruv] {
  /* Keep surface as base, push slightly darker/lighter via brightness */
  filter: brightness(0.94);
  transition: filter 100ms ease;
}

/* ───────────────────────── DATA CELLS ───────────────────────────────────── */
.health-table tbody td.data-cell[b-sh2gg1cruv] {
  padding: 0;
  vertical-align: middle;
  transition: background-color 100ms ease;
}

.health-table tbody td.filler-cell[b-sh2gg1cruv] {
  padding: 0;
  background-color: var(--mud-palette-surface, #fff);
}

.health-table tbody tr:hover td.filler-cell[b-sh2gg1cruv] {
  background-color: rgba(128, 128, 128, 0.08);
  transition: background-color 100ms ease;
}

/* Flex wrapper — centers the icon inside the fixed-width cell */
.health-table td .cell-inner[b-sh2gg1cruv] {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 36px;
}

.health-table td .health-cell-tooltip[b-sh2gg1cruv] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

.health-table td .health-cell-tooltip[b-sh2gg1cruv]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  min-width: 160px;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(38, 39, 48, 0.96);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: pre-line;
  text-align: left;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 120ms ease, transform 120ms ease;
}

.health-table td .health-cell-tooltip[b-sh2gg1cruv]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: rgba(38, 39, 48, 0.96) transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 120ms ease;
}

.health-table td .health-cell-tooltip:hover[b-sh2gg1cruv]::after,
.health-table td .health-cell-tooltip:hover[b-sh2gg1cruv]::before,
.health-table td .health-cell-tooltip:focus-visible[b-sh2gg1cruv]::after,
.health-table td .health-cell-tooltip:focus-visible[b-sh2gg1cruv]::before {
  opacity: 1;
}

.health-table td .health-cell-tooltip:hover[b-sh2gg1cruv]::after,
.health-table td .health-cell-tooltip:focus-visible[b-sh2gg1cruv]::after {
  transform: translateX(-50%) translateY(0);
}

.health-table td .cell-empty[b-sh2gg1cruv] {
  color: rgba(128, 128, 128, 0.50);
  font-size: 0.9rem;
}
