 :root {
  --bg: #0b1220;
  --bg-2: #0d1526;
  --panel: rgba(16, 24, 40, 0.78);
  --panel-2: rgba(15, 23, 42, 0.92);
  --stroke: rgba(148, 163, 184, 0.14);
  --stroke-strong: rgba(148, 163, 184, 0.24);
  --text: #e5eefc;
  --muted: #94a3b8;
  --blue: #4f7cff;
  --blue-2: #6d98ff;
  --cyan: #2dd4bf;
  --violet: #8b5cf6;
  --danger: #ff8aa1;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 264px;
  --content-max: 1480px;
  --card-shadow: 0 20px 50px rgba(2, 6, 23, 0.34);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 124, 255, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.12), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

.page-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(7, 14, 28, 0.92), rgba(10, 17, 32, 0.82));
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 18px;
  margin-bottom: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 10px 30px rgba(79, 124, 255, 0.35);
}

.brand h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

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

.nav {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #cfe0ff;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid transparent;
  transition: 0.22s ease;
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.24), rgba(109, 152, 255, 0.16));
  border-color: rgba(109, 152, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.nav-icon {
  width: 20px;
  text-align: center;
  opacity: 0.95;
}

.sidebar-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.03);
}

.main {
  padding: 28px;
}

.content {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

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

.headline h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.03em;
}

.headline p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 880px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(14px);
}

.hero-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.subscription-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

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

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: rgba(79, 124, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.12);
}

.primary-btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 22px;
  min-width: 190px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 12px 30px rgba(79, 124, 255, 0.32);
}

.primary-btn:hover {
  filter: brightness(1.06);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mini-stat {
  padding: 18px;
  min-height: 116px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.82), rgba(15, 23, 42, 0.92));
  border: 1px solid var(--stroke);
  box-shadow: var(--card-shadow);
}

.mini-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.mini-value {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.info-card,
.error-card {
  padding: 16px 18px;
  border-radius: 18px;
}

.info-card {
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.info-title {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.error-card {
  color: #ffd5dd;
  background: rgba(59, 18, 26, 0.7);
  border: 1px solid rgba(255, 138, 161, 0.25);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

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

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #dce7fb;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.servers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.server-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.82), rgba(15, 23, 42, 0.92));
  border: 1px solid var(--stroke);
  box-shadow: var(--card-shadow);
}

.server-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.server-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.server-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.meta-item {
  padding: 14px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.meta-key {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.meta-value {
  display: block;
  word-break: break-word;
  font-size: 14px;
  color: var(--text);
}

.mono {
  font-family: Consolas, Monaco, monospace;
  word-break: break-all;
}

@media (max-width: 1320px) {
  .servers-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .page-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--stroke);
  }
  .nav { grid-template-columns: 1fr; }
  .main { padding: 18px; }
  .subscription-form { grid-template-columns: 1fr; }
  .mini-stats { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .topbar,
  .section-head,
  .server-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .server-grid { grid-template-columns: 1fr; }
  .primary-btn { width: 100%; }
}


.health-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.health-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.04);
}

.health-dot.green {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.health-dot.yellow {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
}

.health-dot.red {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
}

.health-text {
  font-size: 13px;
  font-weight: 700;
  color: #dce7fb;
}

.latency-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #cfe0ff;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.slot-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.slot-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
}

.slot-select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.78);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  outline: none;
}

.slot-select:focus {
  border-color: rgba(79, 124, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.12);
}

.server-headline {
  display: grid;
  gap: 2px;
}



.build-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.loading-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.loading-text {
  margin-bottom: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.loading-bar {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.loading-bar-fill {
  width: 38%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.9), rgba(52, 211, 153, 0.9));
  animation: loading-slide 1.25s ease-in-out infinite;
}

@keyframes loading-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.test-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 18px;
}

.secondary-btn {
  min-width: 110px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
}

.secondary-btn:disabled {
  opacity: 0.7;
  cursor: default;
}

.test-result {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.test-result.green {
  color: #86efac;
}

.test-result.yellow {
  color: #fde68a;
}

.test-result.red {
  color: #fca5a5;
}

.meta-subline {
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.56);
}


.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  padding: 28px;
  display: grid;
  gap: 18px;
}

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

.auth-brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

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

.auth-head h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.auth-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-btn {
  width: 100%;
  min-width: 0;
}

.auth-alert {
  margin: 0;
}

.auth-meta {
  font-size: 13px;
  color: var(--muted);
}
