:root {
  color-scheme: dark;
  --bg: #080b14;
  --bg-2: #0d1220;
  --panel: rgba(13, 18, 32, 0.8);
  --panel-2: rgba(19, 27, 47, 0.9);
  --text: #eef3ff;
  --muted: #9aa7c7;
  --line: rgba(255,255,255,0.08);
  --ok: #35d59a;
  --warn: #ffca63;
  --bad: #ff7575;
  --ours: #7db0ff;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(81, 147, 255, 0.18), transparent 26%),
    radial-gradient(circle at 100% 0%, rgba(53, 213, 154, 0.12), transparent 22%),
    linear-gradient(180deg, #06080f 0%, #0a0f1b 100%);
}

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 18px 42px;
}

.glass {
  background: linear-gradient(180deg, rgba(17,23,39,.88), rgba(12,17,31,.86));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  border-radius: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(340px, .8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.hero-copy {
  padding: 22px 8px 6px 4px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #89b0ff;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .78rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: .96;
}

.subtitle {
  max-width: 860px;
  color: var(--muted);
  margin: 16px 0 0;
  font-size: 1.05rem;
  line-height: 1.65;
}

.hero-panel {
  padding: 20px;
  align-self: stretch;
}

.hero-panel-grid {
  display: grid;
  gap: 16px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 6px;
}

.hero-panel strong {
  font-size: 1.4rem;
}

.toolbar {
  padding: 16px;
  margin-bottom: 18px;
}

.toolbar-grid {
  display: grid;
  gap: 16px;
}

.toolbar-main-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.primary-btn {
  border: 0;
  padding: 14px 20px;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
  color: #07111f;
  background: linear-gradient(135deg, #83afff 0%, #5ce3b0 100%);
}

.primary-btn:disabled {
  opacity: .7;
  cursor: wait;
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.03);
}

.toolbar-filters {
  display: grid;
  grid-template-columns: minmax(280px, 1.4fr) minmax(200px, .5fr) minmax(220px, .6fr);
  gap: 12px;
}

label span {
  display: block;
  color: var(--muted);
  font-size: .9rem;
  margin: 0 0 8px;
}

input, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  outline: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 16px 18px;
}

.summary-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-card strong {
  font-size: 1.8rem;
}

.table-shell {
  padding: 16px;
}

.table-headline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.table-headline h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.table-headline p {
  margin: 0;
  color: var(--muted);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: .92rem;
}

.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-partial { background: var(--warn); }
.dot-bad { background: var(--bad); }
.dot-ours { background: var(--ours); }

.table-scroll {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.services-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
  background: rgba(255,255,255,.015);
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  font-size: .86rem;
  color: #c7d3ef;
  padding: 14px 14px;
  background: rgba(10, 14, 25, .96);
  border-bottom: 1px solid var(--line);
}

tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
}

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

.service-row td[rowspan] {
  background: rgba(255,255,255,.018);
}

.service-name {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 8px;
}

.service-desc,
.target-subtitle,
.row-subtitle,
.muted-cell,
.details-cell {
  color: var(--muted);
}

.target-title {
  font-weight: 700;
}

.target-subtitle,
.details-cell {
  margin-top: 5px;
  font-size: .9rem;
  line-height: 1.45;
  word-break: break-word;
}

.latency-strong {
  font-weight: 700;
}

.badge,
.mono-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .83rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-ok { background: rgba(53, 213, 154, .14); color: #7cf0bf; }
.badge-partial { background: rgba(255, 202, 99, .14); color: #ffd77f; }
.badge-remote_no_response { background: rgba(255, 117, 117, .14); color: #ff9b9b; }
.badge-remote_http_error { background: rgba(255, 202, 99, .14); color: #ffd77f; }
.badge-our_side_error { background: rgba(125, 176, 255, .14); color: #a9c9ff; }
.mono-pill {
  color: #d9e3ff;
  background: rgba(255,255,255,.05);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.hidden { display: none; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .toolbar-filters { grid-template-columns: 1fr; }
  .table-headline { flex-direction: column; align-items: start; }
}
