:root {
  --bg: #0b0f14;
  --panel: rgba(15, 21, 29, 0.88);
  --panel-strong: #121922;
  --ink: #edf3fb;
  --muted: #98a6b7;
  --accent: #16a34a;
  --accent-strong: #22c55e;
  --danger: #ef4444;
  --line: rgba(148, 163, 184, 0.18);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 24%),
    linear-gradient(180deg, #0d131a 0%, var(--bg) 100%);
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 20px 40px;
}

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

.auth-panel {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.auth-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.form-status.error {
  color: #fca5a5;
}

.form-status.success {
  color: #86efac;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7dd3fc;
  font-size: 12px;
}

h1, h2 {
  margin: 0;
  font-weight: 600;
}

h1 {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.95;
}

h2 {
  font-size: 20px;
}

.subtitle {
  max-width: 720px;
  color: var(--muted);
  margin: 10px 0 0;
  font-size: 17px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: #04110a;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.secondary {
  background: #253140;
  color: var(--ink);
}

.button.danger {
  background: var(--danger);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  overflow: visible;
}

.panel {
  position: relative;
  overflow: visible;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.panel-wide {
  grid-column: span 2;
}

.config-panel {
  z-index: 30;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge.muted {
  background: #263243;
  color: #d0dae7;
}

.badge.live {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.badge.error {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.config-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group-wide {
  grid-column: span 2;
}

.field-group label {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-group input,
.field-group select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 15px;
}

.combo-box {
  position: relative;
  z-index: 50;
}

.combo-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: max(100%, 320px);
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(12, 18, 26, 0.98);
  box-shadow: var(--shadow);
  z-index: 80;
  padding: 6px;
}

.combo-menu.hidden {
  display: none;
}

.combo-option,
.combo-empty,
.combo-loading {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 14px;
}

.combo-option {
  cursor: pointer;
}

.combo-option:hover,
.combo-option.active {
  background: rgba(125, 211, 252, 0.14);
}

.combo-option small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.combo-empty,
.combo-loading {
  color: var(--muted);
}

.combo-menu::-webkit-scrollbar {
  width: 10px;
}

.combo-menu::-webkit-scrollbar-thumb {
  background: rgba(152, 166, 183, 0.25);
  border-radius: 999px;
}

.field-group input:focus,
.field-group select:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.55);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.12);
}

.stat-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.stat-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.stat-list dt {
  color: var(--muted);
}

.stat-list dd {
  margin: 0;
  text-align: right;
  max-width: 65%;
  word-break: break-word;
}

.logs {
  margin: 0;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  padding: 18px;
  background: #0a0f15;
  color: #dbe7f5;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
}

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

  .grid {
    grid-template-columns: 1fr;
  }

  .panel-wide {
    grid-column: span 1;
  }

  .field-group-wide {
    grid-column: span 1;
  }
}
