:root {
  color-scheme: dark;
  --bg-app: #080913;
  --bg-muted: rgba(255, 255, 255, 0.04);
  --border-color: rgba(255, 255, 255, 0.06);
  --card-bg: rgba(14, 15, 26, 0.72);
  --card-bg-solid: #0f111b;
  --card-foreground: #f8f6ff;
  --primary: #494394;
  --primary-soft: rgba(73, 67, 148, 0.24);
  --primary-border: rgba(115, 109, 182, 0.45);
  --success: #16a34a;
  --warning: #facc15;
  --danger: #ef4444;
  --drop-shadow: 0 24px 72px -40px rgba(73, 67, 148, 0.9);
  --radius-lg: 24px;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(73, 67, 148, 0.28), transparent 55%),
    radial-gradient(circle at bottom right, rgba(73, 67, 148, 0.18), transparent 45%),
    var(--bg-app);
  color: var(--card-foreground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-position: center;
  background-origin: initial;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

a {
  color: inherit;
}

.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  box-shadow: var(--drop-shadow);
}

.surface-border {
  border: 1px solid var(--border-color);
}

.shadow-soft {
  box-shadow: 0 30px 80px -60px rgba(17, 19, 30, 0.9);
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(73, 67, 148, 0.18);
  color: rgba(226, 224, 255, 0.92);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-blur {
  background: rgba(8, 9, 19, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gradient-ring {
  position: relative;
  display: inline-flex;
}

.gradient-ring::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(73, 67, 148, 0.6);
  opacity: 0.85;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.metric-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.metric-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(19, 22, 36, 0.92), rgba(12, 13, 24, 0.92));
  padding: 20px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card h3 {
  margin: 0;
  color: rgba(212, 209, 250, 0.82);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.metric-desc {
  margin-top: 0.35rem;
  color: rgba(196, 193, 232, 0.64);
  font-size: 12px;
}

.card-section {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(12, 13, 24, 0.88);
  padding: 24px;
}

.table-wrap {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-wrap thead {
  background: rgba(73, 67, 148, 0.12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.table-wrap th,
.table-wrap td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-wrap tbody tr:hover {
  background: rgba(73, 67, 148, 0.08);
}

.form-grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.input-shell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-shell label {
  font-size: 13px;
  color: rgba(226, 224, 255, 0.72);
  letter-spacing: 0.02em;
}

.input-shell input,
.input-shell textarea,
.input-shell select {
  background: rgba(11, 12, 22, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
  color: #f5f3ff;
  font-size: 14px;
  transition: border 0.15s ease;
}

.input-shell textarea {
  min-height: 112px;
  resize: vertical;
}

.input-shell input:focus,
.input-shell textarea:focus,
.input-shell select:focus {
  outline: none;
  border-color: rgba(131, 125, 206, 0.6);
  box-shadow: 0 0 0 4px rgba(73, 67, 148, 0.22);
}

.btn-surface {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 12, 22, 0.76);
  color: #f2f0ff;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.btn-surface:hover {
  transform: translateY(-1px);
  border-color: rgba(131, 125, 206, 0.45);
}

.btn-primary {
  background: linear-gradient(135deg, #5b55b1, #494394);
  border-color: rgba(224, 222, 255, 0.24);
  color: white;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.tag-muted {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(214, 213, 244, 0.82);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(73, 67, 148, 0.12);
  color: rgba(223, 221, 255, 0.8);
  font-size: 12px;
}

.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(223, 221, 255, 0.92);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-online {
  background: rgba(74, 222, 128, 0.9);
}

.status-offline {
  background: rgba(248, 113, 113, 0.9);
}

.link-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(230, 228, 255, 0.84);
  text-decoration: none;
  transition: border 0.2s ease;
}

.link-pill:hover {
  border-color: rgba(131, 125, 206, 0.45);
}

.overlay-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(73, 67, 148, 0.35), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(73, 67, 148, 0.18), transparent 55%);
  filter: blur(60px);
  opacity: 0.85;
  pointer-events: none;
}

.border-fade {
  border-image: linear-gradient(180deg, rgba(134, 130, 189, 0.35), rgba(54, 56, 85, 0.08)) 1;
}

.backdrop-ring {
  position: relative;
  z-index: 0;
}

.backdrop-ring::after {
  content: '';
  position: absolute;
  inset: -70% -20%;
  background: radial-gradient(circle, rgba(73, 67, 148, 0.3), transparent 70%);
  filter: blur(80px);
  z-index: -1;
}

.nav-floating {
  position: sticky;
  top: 0;
  z-index: 50;
}

.badge-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(227, 225, 255, 0.72);
}

.docs-prose {
  max-width: 800px;
  width: 100%;
}

.docs-prose h2,
.docs-prose h3 {
  color: rgba(236, 234, 255, 0.94);
  letter-spacing: -0.01em;
}

.docs-prose code {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 3px 6px;
}

.docs-prose pre {
  background: rgba(14, 15, 26, 0.82);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px;
  overflow-x: auto;
}

.docs-prose pre code {
  background: transparent;
  padding: 0;
  font-size: 13px;
}

.anchor-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(73, 67, 148, 0.15);
  color: rgba(220, 218, 255, 0.84);
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  background: rgba(11, 12, 22, 0.74);
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  color: rgba(214, 213, 244, 0.68);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: rgba(236, 234, 255, 0.92);
}

.toggle {
  position: relative;
  width: 42px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}

.toggle[data-active="true"] {
  background: rgba(73, 67, 148, 0.85);
}

.toggle[data-active="true"]::after {
  transform: translateX(20px);
}

.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(14, 15, 26, 0.92);
  box-shadow: 0 18px 48px -30px rgba(73, 67, 148, 0.9);
  opacity: 0;
  transform: translate3d(24px, 0, 0);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.toast-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: rgba(236, 234, 255, 0.9);
}

.toast-success {
  border-left: 3px solid rgba(74, 222, 128, 0.85);
}

.toast-error {
  border-left: 3px solid rgba(248, 113, 113, 0.85);
}

.toast-warning {
  border-left: 3px solid rgba(250, 204, 21, 0.85);
}

.toast-info {
  border-left: 3px solid rgba(165, 180, 252, 0.85);
}

::selection {
  background: rgba(73, 67, 148, 0.5);
  color: white;
}

@media (max-width: 768px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toast-container {
    left: 16px;
    right: 16px;
  }

  .toast {
    min-width: unset;
  }
}