:root {
  --bg: #070a12;
  --bg-soft: #0d1220;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(20, 31, 56, 0.95);
  --line: rgba(125, 211, 252, 0.2);
  --line-strong: rgba(129, 140, 248, 0.42);
  --text: #eef6ff;
  --muted: #94a9c4;
  --accent: #67e8f9;
  --accent-2: #a78bfa;
  --accent-3: #38bdf8;
  --danger: #fb7185;
  --ok: #6ee7b7;
  --warning: #facc15;
  --cursor-main: crosshair;
  --cursor-action: pointer;
  --cursor-text: text;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(103, 232, 249, 0.18), transparent 30%),
    radial-gradient(circle at 82% 16%, rgba(167, 139, 250, 0.20), transparent 28%),
    radial-gradient(circle at 50% 90%, rgba(56, 189, 248, 0.09), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: var(--cursor-main);
}

button, input, textarea, select {
  font: inherit;
}

button, a, summary, .nav, .file-item, .card, [role="button"], select, option {
  cursor: var(--cursor-action);
}

button {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.20), rgba(167, 139, 250, 0.18)),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.78rem 1rem;
  border-radius: 14px;
  cursor: pointer;
  transition: 180ms ease;
  font-weight: 700;
}

button:hover {
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(103, 232, 249, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.48);
  color: var(--text);
  padding: 0.8rem 1rem;
  border-radius: 14px;
  outline: none;
  cursor: var(--cursor-text);
}

textarea {
  min-height: 260px;
  resize: vertical;
  line-height: 1.5;
}

pre {
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  background: rgba(2, 6, 23, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem;
  cursor: text;
}

code {
  color: var(--accent);
  background: rgba(103, 232, 249, 0.09);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 8px;
  padding: 0.12rem 0.35rem;
}

.hidden {
  display: none !important;
}

.stars::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(103, 232, 249, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 232, 249, 0.06) 1px, transparent 1px),
    radial-gradient(#ffffff80 1px, transparent 1px);
  background-size: 54px 54px, 54px 54px, 120px 120px;
  animation: drift 28s linear infinite;
  opacity: 0.18;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(80px); }
}

.login-shell {
  width: min(1160px, calc(100vw - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.25rem;
  align-items: center;
  padding: 8vh 0;
}

.login-hero,
.login-card {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.login-hero {
  min-height: 520px;
  padding: clamp(2rem, 5vw, 4rem);
  position: relative;
  overflow: hidden;
}

.login-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(103, 232, 249, 0.20);
  background: radial-gradient(circle, rgba(103, 232, 249, 0.16), transparent 62%);
}

.login-card {
  padding: 2rem;
}

.login-hero h1 {
  max-width: 760px;
  margin: 1rem 0;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

.hero-copy {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.75;
}

.eyebrow,
.login-badge {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 800;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.8rem;
  margin-top: 2rem;
  max-width: 720px;
}

.feature-grid span {
  border: 1px solid rgba(103, 232, 249, 0.16);
  border-radius: 16px;
  padding: 0.95rem;
  background: rgba(255, 255, 255, 0.045);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
}

.brand-mark {
  color: var(--accent);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0.4rem 0.6rem;
  background: rgba(103, 232, 249, 0.09);
  box-shadow: inset 0 0 18px rgba(103, 232, 249, 0.10);
}

#login-form {
  display: grid;
  gap: 1rem;
}

.error {
  color: var(--danger);
}

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

.sidebar {
  padding: 1.15rem;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.82)),
    rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(20px);
  max-height: 100vh;
  overflow: auto;
}

.sidebar .brand {
  margin-bottom: 2rem;
}

.nav, .logout {
  width: 100%;
  margin-bottom: 0.5rem;
  text-align: left;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav.active {
  border-color: rgba(103, 232, 249, 0.32);
  color: white;
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.17), rgba(167, 139, 250, 0.10)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 3px 0 0 var(--accent);
}

.logout {
  margin-top: 2rem;
  border-color: rgba(255, 95, 122, 0.35);
}

.content {
  padding: clamp(1rem, 2vw, 2rem);
  max-width: 1600px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 24px;
  padding: 1.2rem;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  margin: 0;
  letter-spacing: -0.04em;
}

.topbar p, .hint {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel, .card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent),
    var(--panel);
  padding: 1.1rem;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.25);
  margin-bottom: 1rem;
}

.panel:hover,
.card:hover {
  border-color: rgba(103, 232, 249, 0.32);
}

.card h3 {
  margin-top: 0;
}

.status-online {
  color: var(--ok);
}

.status-stopped, .status-errored {
  color: var(--danger);
}

.config-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.config-card,
.field {
  border: 1px solid rgba(125, 211, 252, 0.14);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.28);
  padding: 0.8rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field.full {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2,
.section-head h3 {
  margin: 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.editor-list {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.editor-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr)) auto;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.035);
}

.editor-row.compact {
  grid-template-columns: repeat(2, minmax(220px, 1fr)) auto;
}

.editor-row.ticket-row,
.editor-row.music-row {
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
}

.editor-row textarea {
  min-height: 110px;
}

.danger {
  border-color: rgba(255, 95, 122, 0.45);
  background: rgba(255, 95, 122, 0.12);
}

.danger:hover {
  border-color: var(--danger);
  box-shadow: 0 0 24px rgba(255, 95, 122, 0.2);
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 18px;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.04);
}

.file-item strong {
  color: #ffffff;
}

.file-item small {
  color: var(--muted);
}

.backup-badge {
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(103, 232, 249, 0.08);
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.command-pill {
  display: inline-flex;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
}

.card pre {
  max-height: 180px;
  font-size: 0.84rem;
}

.field input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, 0.12);
}

::selection {
  background: rgba(103, 232, 249, 0.35);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(103, 232, 249, 0.45), rgba(167, 139, 250, 0.45));
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
    padding: 1rem 0;
  }

  .login-hero {
    min-height: auto;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .section-head,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-row,
  .editor-row.compact,
  .editor-row.ticket-row,
  .editor-row.music-row {
    grid-template-columns: 1fr;
  }
}
