:root {
  --bg: #0a0f1c;
  --panel: #0f172a;
  --panel-2: #121b31;
  --primary: #4ba7ff;
  --primary-strong: #5be0b3;
  --text: #e8edf5;
  --muted: #92a3c2;
  --line: #1f2a44;
  --warning: #ffcc66;
  --danger: #ff7a7a;
  --success: #80ffea;
  --glass: rgba(255, 255, 255, 0.04);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  font-family: "Manrope", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(120% 90% at 10% 10%, rgba(91, 224, 179, 0.08), transparent 50%),
              radial-gradient(80% 60% at 90% 20%, rgba(75, 167, 255, 0.14), transparent 50%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

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

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0d1527 0%, #0b1120 100%);
  border-right: 1px solid var(--line);
  padding: 22px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 18px;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: radial-gradient(circle at 30% 30%, #5be0b3, #2b87ff 60%, #1c2f55);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.nav { display: grid; gap: 8px; }
.nav h4 {
  margin: 12px 0 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  transition: background 0.2s, transform 0.15s;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-item.active {
  background: var(--glass);
  border-color: var(--line);
}

.nav-item:not(.active) .nav-dot { opacity: 0.4; }
.nav-item:hover { background: var(--glass); transform: translateX(2px); }
.nav-item:not(.active) .nav-label { color: var(--text); }
.nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(120deg, #5be0b3, #4ba7ff);
  box-shadow: 0 0 0 5px rgba(91, 224, 179, 0.08);
}
.nav-label { font-weight: 600; }
.new-badge {
  background: rgba(75, 167, 255, 0.16);
  color: #b6d9ff;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 24px 24px;
  gap: 20px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: auto;
}

.page { display: none; height: 100%; }
.page.active { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; }
.hide-describe { display: none; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pill strong { color: var(--text); }

.button {
  border: none;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #051327;
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  box-shadow: 0 8px 30px rgba(75, 167, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 12px 40px rgba(91, 224, 179, 0.28); }
.button.ghost {
  background: var(--glass);
  color: var(--text);
  box-shadow: none;
  border: 1px solid var(--line);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.muted { color: var(--muted); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(91, 224, 179, 0.12);
  color: #b7ffe6;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: 12px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
}
.input::placeholder { color: var(--muted); }

.radio-group, .select-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-option {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--glass);
  color: var(--text);
  font-weight: 600;
}
.chip-option.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(75,167,255,0.16);
}
.chip-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}
textarea.input {
  min-height: 160px;
  line-height: 1.5;
  resize: vertical;
}

.btn-sm {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}
.btn-sm.primary {
  border-color: var(--primary);
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  color: #051327;
}

.status-pill { padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 12px; border:1px solid var(--line); }
.status-pill.ok { color: #b7ffe6; border-color: rgba(91,224,179,0.4); }
.status-pill.error { color: #ffc0c0; border-color: rgba(255,122,122,0.5); }

.status-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.status { background: var(--panel-2); padding: 10px; border-radius: 10px; border: 1px solid var(--line); }
.status strong { display: block; color: var(--muted); font-size: 12px; }
.status span { font-size: 16px; font-weight: 800; }
.divider { height: 1px; background: var(--line); margin: 10px 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 16px;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  width: min(600px, 100%);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.checkbox { width: 18px; height: 18px; }
.tooltip { color: var(--muted); font-size: 12px; }
.small-note { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
