:root {
  --purple: #7C3AED;
  --purple-light: #EDE9FE;
  --green: #22C55E;
  --green-bg: #F0FDF4;
  --green-border: #BBF7D0;
  --amber: #F59E0B;
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  --red: #EF4444;
  --red-bg: #FEF2F2;
  --red-border: #FECACA;
  --g50: #F8FAFC;
  --g100: #F1F5F9;
  --g200: #E2E8F0;
  --g300: #CBD5E1;
  --g400: #94A3B8;
  --g500: #64748B;
  --g600: #475569;
  --g700: #334155;
  --g800: #1E293B;
  --g900: #0F172A;
  --bg: #FAFBFD;
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'Space Grotesk', 'SF Mono', monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--g800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 12% 10%, rgba(124,58,237,.04) 0%, transparent 100%),
    radial-gradient(ellipse 500px 500px at 88% 30%, rgba(124,58,237,.035) 0%, transparent 100%),
    radial-gradient(ellipse 700px 400px at 50% 85%, rgba(124,58,237,.03) 0%, transparent 100%),
    radial-gradient(circle 200px at 30% 50%, rgba(124,58,237,.02) 0%, transparent 100%),
    radial-gradient(circle 250px at 75% 65%, rgba(124,58,237,.02) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

.sp-wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

/* ═══ Header ═══ */
.sp-header {
  border-top: 3px solid var(--purple);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.sp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--g800);
  font-weight: 600;
  font-size: 17px;
  flex-shrink: 0;
}

.sp-logo-icon {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-radius: 8px;
  flex-shrink: 0;
}

.sp-header-center { text-align: center; flex: 1; min-width: 0; }
.sp-header-center h1 { font-size: 22px; font-weight: 700; color: var(--g900); margin-bottom: 1px; }
.sp-header-center p { font-size: 13px; color: var(--g400); letter-spacing: .3px; }
.sp-powered { font-size: 12px; color: var(--g400); white-space: nowrap; flex-shrink: 0; }

/* ═══ Main ═══ */
.sp-main { padding-top: 28px; padding-bottom: 60px; }

/* ═══ Status Banner ═══ */
.sp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-radius: var(--radius);
  margin-bottom: 28px;
  transition: background .3s, border-color .3s;
}

.sp-banner.up { background: var(--green-bg); border: 1px solid var(--green-border); }
.sp-banner.degraded { background: var(--amber-bg); border: 1px solid var(--amber-border); }
.sp-banner.down { background: var(--red-bg); border: 1px solid var(--red-border); }

.sp-banner-left { display: flex; align-items: center; gap: 16px; }

.sp-banner-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
  font-weight: 700;
}

.sp-banner.up .sp-banner-icon { background: var(--green); }
.sp-banner.degraded .sp-banner-icon { background: var(--amber); }
.sp-banner.down .sp-banner-icon { background: var(--red); }

.sp-banner-text h2 { font-size: 18px; font-weight: 700; color: var(--g900); }
.sp-banner-text p { font-size: 13px; color: var(--g500); margin-top: 2px; }

.sp-banner-right {
  font-size: 14px;
  color: var(--g600);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* ═══ Monitor Cards Grid ═══ */
.sp-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
}

.sp-card {
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s;
}

.sp-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.04); }

.sp-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.sp-card-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--g800);
}

.sp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.sp-dot.up { background: var(--green); animation: pulse 2s ease-in-out infinite; }
.sp-dot.degraded { background: var(--amber); }
.sp-dot.down { background: var(--red); animation: pulse-red 1.5s ease-in-out infinite; }
.sp-dot.nodata { background: var(--g300); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); }
  50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.45); }
  50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

.sp-card-rt {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--g700);
}

.sp-card-rt.ssl-valid { color: var(--green); font-weight: 700; }
.sp-card-rt.ssl-expired { color: var(--red); font-weight: 700; }

.sp-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.sp-card-url {
  font-size: 12px;
  color: var(--g400);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-card-uptime { font-size: 12px; color: var(--g500); font-weight: 500; white-space: nowrap; }

/* ═══ 90-Day Uptime Bars ═══ */
.sp-bars-wrap {
  border-top: 1px solid var(--g100);
  padding-top: 14px;
  margin-top: auto;
}

.sp-bars {
  display: flex;
  gap: 2px;
  height: 34px;
  align-items: flex-end;
}

.sp-bar {
  flex: 1;
  min-width: 0;
  border-radius: 2px;
  height: 100%;
  position: relative;
  cursor: pointer;
  transition: opacity .12s;
}

.sp-bar:hover { opacity: .7; }
.sp-bar.up { background: var(--green); }
.sp-bar.partial { background: var(--amber); }
.sp-bar.down { background: var(--red); }
.sp-bar.nodata { background: var(--g200); }

.sp-bars-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--g400);
}

/* ═══ Tooltip ═══ */
.sp-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--g800);
  color: #fff;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transform: translateX(-50%);
  display: none;
  font-family: var(--font);
}

.sp-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--g800);
}

.sp-tooltip.visible { display: block; }

/* ═══ Sections ═══ */
.sp-section { margin-bottom: 36px; }

.sp-stitle {
  font-size: 17px;
  font-weight: 700;
  color: var(--g800);
  margin-bottom: 16px;
}

/* ═══ Incidents ═══ */
.sp-incident {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: #fff;
  border: 1px solid var(--g200);
  gap: 20px;
}

.sp-incident:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.sp-incident:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.sp-incident:only-child { border-radius: var(--radius); }
.sp-incident + .sp-incident { border-top: none; }

.sp-inc-date {
  font-size: 13px;
  color: var(--g400);
  white-space: nowrap;
  min-width: 130px;
  font-family: var(--mono);
  line-height: 1.5;
}

.sp-inc-info { flex: 1; min-width: 0; }

.sp-inc-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--g800);
}

.sp-inc-desc {
  font-size: 12px;
  color: var(--g400);
  margin-top: 3px;
}

.sp-inc-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sp-inc-badge.resolved { background: var(--green-bg); color: #16a34a; }
.sp-inc-badge.open { background: var(--red-bg); color: var(--red); }

.sp-no-incidents {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  font-size: 14px;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

/* ═══ Chart ═══ */
.sp-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-chart-stats {
  font-size: 13px;
  color: var(--g400);
  font-style: italic;
  font-family: var(--mono);
}

.sp-chart-box {
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 24px 20px 16px;
  overflow: hidden;
}

.sp-chart-box canvas { width: 100%; display: block; }

/* ═══ Info Grid ═══ */
.sp-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.sp-info-box {
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: var(--radius);
  padding: 22px 24px;
}

.sp-info-box h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sp-info-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--g50);
}

.sp-info-row:last-of-type { border-bottom: none; }
.sp-info-row .label { color: var(--g500); }
.sp-info-row .value { font-weight: 500; color: var(--g700); text-align: right; }
.sp-info-row .value.blue { color: #2563EB; }

.sp-ssl-badge {
  font-size: 13px;
  padding: 3px 12px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.sp-ssl-badge.valid { background: var(--green-bg); color: var(--green); }
.sp-ssl-badge.warning { background: var(--amber-bg); color: #b45309; }
.sp-ssl-badge.expired { background: var(--red-bg); color: var(--red); }

.sp-ssl-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--g100);
  margin: 14px 0 8px;
  overflow: hidden;
}

.sp-ssl-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

.sp-ssl-bar-fill.green { background: linear-gradient(90deg, #22c55e, #4ade80); }
.sp-ssl-bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.sp-ssl-bar-fill.red { background: linear-gradient(90deg, #ef4444, #f87171); }

.sp-ssl-note { font-size: 12px; color: var(--g400); }

.sp-next-check {
  margin-top: 16px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  border-radius: 10px;
  font-size: 13px;
  color: #4338CA;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sp-next-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4338CA;
  flex-shrink: 0;
  animation: pulse-blue 2s ease-in-out infinite;
}

@keyframes pulse-blue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(67,56,202,.4); }
  50% { box-shadow: 0 0 0 4px rgba(67,56,202,0); }
}

/* ═══ Footer ═══ */
.sp-footer {
  background: rgba(255,255,255,.5);
  border-top: 1px solid var(--g200);
  padding: 28px 0;
}

.sp-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.sp-footer p { font-size: 13px; color: var(--g400); line-height: 1.7; }
.sp-footer a { color: var(--g500); text-decoration: none; transition: color .15s; }
.sp-footer a:hover { color: var(--purple); }

.sp-footer-links {
  display: flex;
  gap: 24px;
  font-size: 13px;
}

/* ═══ Landing ═══ */
.landing {
  max-width: 560px;
  margin: 100px auto;
  text-align: center;
  padding: 0 24px;
}

.landing h1 { font-size: 28px; font-weight: 700; margin-bottom: 36px; color: var(--g900); }

.landing-list { display: flex; flex-direction: column; gap: 12px; }

.landing-link {
  display: block;
  padding: 18px 24px;
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: 12px;
  text-decoration: none;
  color: var(--g800);
  font-weight: 500;
  font-size: 16px;
  transition: border-color .15s, color .15s, box-shadow .15s;
}

.landing-link:hover {
  border-color: var(--purple);
  color: var(--purple);
  box-shadow: 0 2px 12px rgba(124,58,237,.08);
}

/* ═══ Mobile ═══ */
@media (max-width: 768px) {
  .sp-header-inner { flex-wrap: wrap; gap: 10px; justify-content: center; }
  .sp-powered { display: none; }
  .sp-header-center h1 { font-size: 18px; }

  .sp-banner { flex-direction: column; gap: 12px; align-items: flex-start; padding: 18px 20px; }
  .sp-banner-right { align-self: flex-end; }

  .sp-cards { grid-template-columns: 1fr; }
  .sp-info-grid { grid-template-columns: 1fr; }

  .sp-incident { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 18px; }
  .sp-inc-badge { align-self: flex-end; }

  .sp-chart-head { flex-direction: column; align-items: flex-start; }

  .sp-footer-inner { flex-direction: column; text-align: center; }
  .sp-footer-links { justify-content: center; }
}
