* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e4e6eb;
  min-height: 100vh;
}

.container { max-width: 900px; margin: 0 auto; padding: 32px 24px; }

header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #2d3140;
}

header h1 { font-size: 24px; margin-bottom: 6px; display: inline-flex; align-items: center; gap: 10px; }
.beta-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 3px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  vertical-align: middle;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
  animation: beta-pulse 2s ease-in-out infinite;
}
@keyframes beta-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.6); }
}
header p { color: #8b8fa3; font-size: 14px; }

/* Summary bar */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.summary-card {
  background: #1a1d27;
  border: 1px solid #2d3140;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.summary-card .value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.summary-card .label {
  font-size: 11px;
  color: #8b8fa3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.c-total .value { color: #4f8cff; }
.c-pass .value  { color: #34d399; }
.c-fail .value  { color: #f87171; }

/* Controls */
.controls {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: #4f8cff;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #6da0ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,140,255,0.3);
}

.btn-secondary {
  background: #242836;
  color: #e4e6eb;
  border: 1px solid #2d3140;
}

.btn-secondary:hover:not(:disabled) { background: #2d3140; }

.status-msg {
  font-size: 13px;
  color: #8b8fa3;
  margin-left: auto;
}

/* Endpoint list */
.endpoints {
  background: #1a1d27;
  border: 1px solid #2d3140;
  border-radius: 12px;
  overflow: hidden;
}

.ep-header {
  display: grid;
  grid-template-columns: 44px 1fr 110px;
  padding: 10px 16px;
  background: #242836;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b8fa3;
  font-weight: 600;
}

.ep-row {
  display: grid;
  grid-template-columns: 44px 1fr 110px;
  padding: 14px 16px;
  border-top: 1px solid #2d3140;
  align-items: center;
  transition: background 0.15s;
}

.ep-row:hover { background: #242836; }

.ep-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3a3f50;
}

.dot.pass    { background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,0.4); }
.dot.fail    { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,0.4); }
.dot.testing { background: #4f8cff; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.ep-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}

.ep-info small {
  color: #8b8fa3;
  font-size: 12px;
  word-break: break-all;
}

.ep-category span {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cat-core     { background: #1e3a5f; color: #7db8ff; }
.cat-auth     { background: #3d2e0a; color: #fbbf24; }
.cat-cdn      { background: #0d3025; color: #34d399; }
.cat-reports  { background: #2d1b4e; color: #c084fc; }
.cat-clinical { background: #1a3040; color: #67e8f9; }
.cat-sql-live { background: #3b1a1a; color: #fca5a5; }
.cat-sql-test { background: #3d2e0a; color: #fde68a; }

.ep-latency {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  color: #8b8fa3;
}

.ep-result {
  font-size: 12px;
  font-weight: 600;
}

.result-pass { color: #34d399; }
.result-fail { color: #f87171; }
.result-wait { color: #3a3f50; }

/* Progress bar */
.progress-wrap {
  height: 4px;
  background: #2d3140;
  border-radius: 2px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4f8cff, #34d399);
  border-radius: 2px;
  transition: width 0.3s;
  width: 0%;
}

/* Footer */
footer {
  text-align: center;
  padding: 24px;
  color: #3a3f50;
  font-size: 12px;
  margin-top: 32px;
}

/* IP Info Card */
.ip-card {
  background: #1a1d27;
  border: 1px solid #2d3140;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.ip-card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #e4e6eb;
}

.ip-loading {
  color: #8b8fa3;
  font-size: 13px;
}

.ip-item {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}

.ip-label {
  color: #8b8fa3;
  font-weight: 600;
  min-width: 70px;
}

.ip-value {
  color: #e4e6eb;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* Responsive */
@media (max-width: 640px) {
  .summary { grid-template-columns: repeat(3, 1fr); }
  .ep-header, .ep-row {
    grid-template-columns: 36px 1fr 70px;
  }
  .ep-category, .ep-latency { display: none; }
  .db-card { flex-wrap: wrap; }
}
