:root {
  --bg: #070b16;
  --bg-soft: #0b1221;
  --panel: #101827;
  --panel-2: #131e31;
  --line: #1f2d47;
  --text: #f4f7ff;
  --muted: #8fa1c2;
  --primary: #4f7cff;
  --primary-soft: rgba(79, 124, 255, 0.18);
  --cyan: #2bd4f7;
  --orange: #ff8e4d;
  --green: #20db7f;
  --amber: #ffc857;
  --red: #ff5d73;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  background:
    radial-gradient(1200px 500px at -10% -20%, rgba(47, 95, 255, 0.2), transparent 55%),
    radial-gradient(1000px 600px at 120% 0%, rgba(255, 142, 77, 0.2), transparent 52%),
    linear-gradient(170deg, #060b14 0%, #080e1b 40%, #070c18 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

h1,
h2,
h3,
.brand-title {
  font-family: "Sora", "Avenir Next", "Segoe UI", sans-serif;
}

.bg-orb {
  position: fixed;
  width: 340px;
  height: 340px;
  filter: blur(90px);
  border-radius: 999px;
  opacity: 0.45;
  z-index: 0;
  pointer-events: none;
}

.orb-a {
  left: -120px;
  top: 80px;
  background: #2d7fff;
}

.orb-b {
  right: -100px;
  bottom: 60px;
  background: #ff8a3d;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 30, 49, 0.86), rgba(10, 16, 29, 0.92));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff;
  font-size: 18px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-sub {
  color: var(--muted);
  font-size: 12px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: 180ms ease;
}

.side-link:hover {
  border-color: #314568;
  background: rgba(79, 124, 255, 0.08);
}

.side-link.active {
  border-color: #3e5fa0;
  background: linear-gradient(90deg, rgba(79, 124, 255, 0.24), rgba(79, 124, 255, 0.08));
}

.side-icon {
  width: 22px;
  text-align: center;
  color: var(--cyan);
}

.sidebar-foot {
  margin-top: auto;
}

.small-muted {
  color: var(--muted);
  font-size: 12px;
}

.env-badge {
  margin-top: 8px;
  display: inline-flex;
  padding: 6px 10px;
  border: 1px solid #355689;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.14);
  font-size: 12px;
}

.workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.topbar {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.2px;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(32, 219, 127, 0.75);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(32, 219, 127, 0.75);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(32, 219, 127, 0);
  }
}

#statusBadge {
  color: var(--muted);
  font-size: 13px;
}

button,
.btn-primary {
  border: 1px solid #32486d;
  background: #101a2e;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  transition: 180ms ease;
}

button:hover,
.btn-primary:hover {
  transform: translateY(-1px);
  border-color: #4c6fa3;
}

.btn-primary {
  background: linear-gradient(135deg, #2e63ff, #4f7cff);
  border-color: #4f7cff;
  box-shadow: 0 8px 20px rgba(79, 124, 255, 0.32);
}

.tab {
  display: none;
  animation: fadeIn 220ms ease;
}

.tab.active {
  display: block;
}

.tab > .panel + .panel {
  margin-top: 12px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.kpi-card {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid #223454;
  background: linear-gradient(150deg, rgba(20, 33, 55, 0.95), rgba(11, 18, 33, 0.95));
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.kpi-value {
  font-family: "Sora", sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 6px;
}

.kpi-trend {
  font-size: 12px;
  color: var(--cyan);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.overview-grid.bottom {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 12px;
}

.chart-panel,
.donut-panel,
.panel {
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.chart-wrap {
  min-height: 260px;
}

.chart-svg {
  width: 100%;
  height: 260px;
}

.chart-grid line {
  stroke: rgba(143, 161, 194, 0.15);
}

.chart-label {
  fill: #8fa1c2;
  font-size: 11px;
  font-family: "IBM Plex Sans", sans-serif;
}

.line-pass {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
}

.area-pass {
  fill: url(#areaPassGradient);
}

.point {
  fill: #9be6ff;
  stroke: #08263a;
  stroke-width: 1.5;
}

.donut-wrap {
  position: relative;
  width: 230px;
  height: 230px;
  margin: 10px auto 12px;
}

.donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid #24354f;
  background: conic-gradient(var(--red) 0deg, var(--red) 120deg, var(--amber) 120deg, var(--amber) 220deg, var(--green) 220deg, var(--green) 360deg);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 20% 20%, #182743, #0d1527 80%);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  z-index: 2;
}

.donut-total {
  font-family: "Sora", sans-serif;
  font-size: 34px;
  font-weight: 700;
}

.legend {
  display: grid;
  gap: 8px;
}

.legend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.legend-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(143, 161, 194, 0.14);
  text-align: left;
  white-space: nowrap;
}

th {
  color: #9eb1d6;
  font-weight: 500;
}

td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: rgba(79, 124, 255, 0.12);
  border: 1px solid rgba(79, 124, 255, 0.35);
  padding: 2px 6px;
  border-radius: 7px;
}

.tiny-btn {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid #3a5786;
  background: rgba(79, 124, 255, 0.14);
}

.run-detail-panel {
  margin-top: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
}

.status-passed,
.status-resolved {
  color: var(--green);
  border-color: rgba(32, 219, 127, 0.4);
  background: rgba(32, 219, 127, 0.12);
}

.status-failed,
.status-open,
.status-timed_out,
.status-interrupted {
  color: var(--red);
  border-color: rgba(255, 93, 115, 0.45);
  background: rgba(255, 93, 115, 0.14);
}

.status-monitoring,
.status-skipped {
  color: var(--amber);
  border-color: rgba(255, 200, 87, 0.45);
  background: rgba(255, 200, 87, 0.14);
}

.filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  color: var(--muted);
  font-size: 12px;
  display: grid;
  gap: 5px;
}

input {
  background: #0b1324;
  border: 1px solid #30486f;
  color: var(--text);
  border-radius: 9px;
  padding: 9px 10px;
  min-width: 220px;
}

.json-output {
  margin: 0;
  min-height: 260px;
  background: #0b1324;
  border: 1px solid #273a5a;
  border-radius: 10px;
  padding: 14px;
  overflow: auto;
  color: #d6e2ff;
  font-size: 13px;
}

.heat-badge {
  display: inline-flex;
  min-width: 54px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid #365074;
  background: #0d182b;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #32486d;
  background: rgba(79, 124, 255, 0.12);
  font-size: 11px;
  letter-spacing: 0.2px;
}

.test-detail {
  margin: 0;
  min-height: 220px;
  background: #0b1324;
  border: 1px solid #273a5a;
  border-radius: 10px;
  padding: 14px;
  color: #d6e2ff;
  font-size: 14px;
}

.test-detail h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.test-detail p {
  margin: 8px 0;
  color: #b7c8ea;
  line-height: 1.5;
}

.test-detail ol {
  margin: 10px 0 0 18px;
  padding: 0;
  color: #dce8ff;
}

.test-detail li {
  margin: 6px 0;
}

.matrix-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #2f415f;
  background: #0b1424;
  font-size: 11px;
  text-transform: uppercase;
}

.matrix-pass {
  border-color: rgba(32, 219, 127, 0.42);
  color: var(--green);
  background: rgba(32, 219, 127, 0.12);
}

.matrix-fail {
  border-color: rgba(255, 93, 115, 0.44);
  color: var(--red);
  background: rgba(255, 93, 115, 0.12);
}

.matrix-other {
  border-color: #334864;
  color: #97add5;
}

.with-filters {
  align-items: flex-end;
}

@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  .overview-grid,
  .overview-grid.bottom {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    padding: 14px;
  }

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

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  input {
    min-width: 160px;
  }
}
