:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-strong: #eef2f7;
  --sidebar: #111827;
  --sidebar-2: #172033;
  --text: #111827;
  --muted: #64748b;
  --border: #d8dee8;
  --accent: #2563eb;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --info: #0369a1;
  --radius: 8px;
  --gap: 8px;
  --sidebar-width: 276px;
  --shadow-subtle: 0 1px 2px rgba(17, 24, 39, 0.06), 0 10px 22px rgba(17, 24, 39, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "IBM Plex Sans", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  color: #e5e7eb;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.11), rgba(37, 99, 235, 0) 32%),
    var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__brand {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
}

.sidebar__brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #ffffff;
  background: #1f3f7c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
}

.sidebar__brand strong {
  display: block;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.2;
}

.sidebar__brand span:last-child {
  display: block;
  margin-top: 2px;
  color: #aeb8ca;
  font-size: 12px;
}

.sidebar-search input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  color: #f8fafc;
  background: var(--sidebar-2);
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: var(--radius);
  outline: none;
}

.sidebar-search input::placeholder {
  color: #94a3b8;
}

.sidebar-search input:focus {
  border-color: rgba(147, 197, 253, 0.72);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.sidebar-nav {
  flex: 1;
  overflow: auto;
  padding-right: 2px;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group[hidden] {
  display: none;
}

.nav-group h2 {
  margin: 0 0 7px;
  padding: 0 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-group ul {
  display: grid;
  gap: 3px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 9px;
  border-radius: var(--radius);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(96, 165, 250, 0.28);
}

.nav-item__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #64748b;
}

.nav-item.is-active .nav-item__dot {
  background: #60a5fa;
}

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 8px 0;
  color: #9aa7ba;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.section-kicker {
  margin: 0 0 3px;
  color: var(--info);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.page-subtitle {
  margin: 5px 0 0;
  color: #475569;
  font-size: 14px;
}

.page-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 380px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid #1d4ed8;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.button:hover {
  background: #1d4ed8;
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button--secondary {
  color: #1e293b;
  background: var(--surface);
  border-color: var(--border);
}

.button--secondary:hover {
  background: var(--surface-strong);
}

.button--compact {
  height: 34px;
}

.page-header__actions [data-refresh] {
  min-width: 108px;
}

.page-header__actions [data-copy-diagnostic] {
  min-width: 148px;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill--ok,
.badge--ok {
  color: #0f5f2d;
  background: #dcfce7;
  border-color: #86efac;
}

.status-pill--degraded,
.badge--degraded {
  color: #8a4105;
  background: #fef3c7;
  border-color: #f9d86b;
}

.badge--skipped {
  color: #475569;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.status-pill--down,
.badge--down {
  color: #9f1239;
  background: #ffe4e6;
  border-color: #fda4af;
}

.status-pill--loading,
.badge--loading {
  color: #075985;
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.last-updated {
  color: #475569;
  font-size: 12px;
  white-space: nowrap;
}

.cache-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  color: #334155;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.cache-indicator--refresh {
  color: #075985;
  background: #e0f2fe;
  border-color: #7dd3fc;
}

.cache-indicator--cache {
  color: #334155;
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.cache-indicator--loading {
  color: #075985;
  background: #e0f2fe;
  border-color: #7dd3fc;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    min-height: auto;
  }

  .workspace {
    padding: 16px;
  }

  .page-header {
    display: grid;
  }

  .page-header__actions {
    justify-content: flex-start;
    min-width: 0;
  }
}
