:root {
  --bg: #0b1021;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --text: #e9ecf5;
  --muted: #9aa3b5;
  --accent: #7cf0ff;
  --accent-2: #a47cff;
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Space Grotesk", "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 10% 20%, rgba(124, 240, 255, 0.06), transparent 25%),
    radial-gradient(circle at 90% 10%, rgba(164, 124, 255, 0.07), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(52, 211, 153, 0.05), transparent 35%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.page.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-template-columns: 1fr;
  padding: 48px 16px;
  min-height: 100vh;
}

.auth-content {
  width: 100%;
  padding: 0;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.auth-wrapper {
  width: min(520px, 100%);
  display: grid;
  gap: 16px;
}

.auth-content .hero,
.auth-wrapper .hero {
  width: 100%;
  justify-content: center;
  text-align: center;
  margin-bottom: 12px;
}

.auth-card {
  width: 100%;
  margin: 0;
}

.auth-content .actions {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #0b1021;
}

.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-name { font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { color: var(--muted); font-size: 13px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-item:hover { background: var(--panel); }
.nav-item.active { background: var(--panel-strong); box-shadow: inset 0 0 0 1px var(--border); }
.nav-item.muted { color: var(--muted); }

.sidebar-footer { margin-top: auto; }
.ghost {
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.content {
  padding: 32px;
  max-width: none;
  width: 100%;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.stat {
  font-size: 30px;
  font-weight: 700;
}
.muted { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1021;
}
.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-danger { background: var(--danger); color: #0b1021; }

table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px 10px;
  text-align: left;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
tr { border-bottom: 1px solid var(--border); }
tr:last-child { border-bottom: none; }

.badge {
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.badge.up { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.badge.down { background: rgba(248, 113, 113, 0.15); color: var(--danger); }
.badge.ssl_warning { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.badge.pending { background: var(--panel); color: var(--muted); }

form label { display: block; margin-bottom: 6px; color: var(--muted); font-weight: 600; }
form input, form select, form textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}
form .actions { display: flex; gap: 12px; margin-top: 12px; }

.messages { display: grid; gap: 10px; margin-bottom: 16px; }
.alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
}
.alert.success { border-color: rgba(52, 211, 153, 0.35); }
.alert.error { border-color: rgba(248, 113, 113, 0.35); }

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.hero-title { font-size: 28px; font-weight: 700; margin: 0; }
.hero-sub { color: var(--muted); margin: 6px 0 0; }

.pill {
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--panel);
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.plan {
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}
.plan-price { font-size: 26px; font-weight: 700; }
.plan-meta { color: var(--muted); margin-bottom: 12px; }
.plan ul { padding-left: 18px; color: var(--muted); }
.plan li { margin-bottom: 6px; }

.uptime-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.uptime-row:last-child { border-bottom: none; }
.uptime-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.uptime-info { flex: 1; min-width: 220px; }
.uptime-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(12px, 1fr);
  gap: 6px;
  align-items: center;
  overflow: hidden;
  width: 100%;
}
.dot {
  width: 8px;
  height: 20px;
  border-radius: 6px;
  background: var(--panel-strong);
}
.dot.up { background: var(--success); }
.dot.down { background: var(--danger); }
.dot.ssl_warning { background: var(--warning); }
.dot.pending { background: var(--muted); }
.dot.warn { background: var(--warning); }

.tooltip-bubble {
  position: fixed;
  z-index: 9999;
  background: #0f172a;
  color: #e9ecf5;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
  transform: translateY(-4px);
}

@media (max-width: 960px) {
  .page { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .content { padding: 20px; }
}
