:root {
  --bg: #282a36;
  --bg-2: #1f2230;
  --panel: rgba(189, 147, 249, 0.08);
  --panel-strong: rgba(189, 147, 249, 0.16);
  --border: rgba(189, 147, 249, 0.25);
  --ink: #f8f8f2;
  --muted: #6272a4;
  --accent: #bd93f9;
  --accent-2: #8be9fd;
  --accent-3: #50fa7b;
  --danger: #ff5555;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, rgba(189, 147, 249, 0.25), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 233, 253, 0.2), transparent 45%),
    linear-gradient(180deg, #1f2230, #282a36 40%, #1f2230 100%);
  min-height: 100vh;
}

a,
a:visited,
a:hover,
a:active {
  color: var(--ink);
  text-decoration: none;
}

body::before {
  content: "";
  position: fixed;
  inset: -20% 0 0 0;
  background: radial-gradient(circle at 30% 0%, rgba(80, 250, 123, 0.12), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(24, 27, 38, 0.75);
  border-bottom: 1px solid var(--border);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

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

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-panel-toggle:checked ~ .theme-panel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.theme-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 90vw);
  height: 100%;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 20;
  overflow-y: auto;
}

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

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

.theme-grid .input {
  margin-bottom: 0;
}

.color-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.color-field input[type="color"] {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  padding: 4px;
  cursor: pointer;
}

.brand a {
  color: var(--ink);
  font-size: 24px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.6px;
}

.tagline {
  color: var(--muted);
  font-size: 14px;
}

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

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise 0.7s ease both;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(46, 196, 182, 0.1), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.card form + form {
  margin-top: 12px;
}

.card p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.card a {
  color: inherit;
  text-decoration: none;
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  margin-bottom: 8px;
}

.stat input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 0.6s ease;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.status-pill.online {
  color: var(--accent-3);
  border-color: rgba(123, 211, 137, 0.4);
}

.status-pill.offline {
  color: var(--danger);
  border-color: rgba(239, 71, 111, 0.4);
}

.status-pill.unknown {
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--muted);
  font-weight: 500;
}

pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  color: var(--ink);
  overflow-x: auto;
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.button.primary {
  background: linear-gradient(120deg, rgba(189, 147, 249, 0.85), rgba(139, 233, 253, 0.85));
  border: none;
  color: var(--bg-2);
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.muted {
  color: var(--muted);
}

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

.hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.chart-card canvas {
  width: 100% !important;
  height: 260px !important;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(8, 10, 14, 0.7);
  color: var(--ink);
  margin-bottom: 10px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .container {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
