* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --green-900: #0f2d1f;
  --green-700: #1e4b34;
  --green-500: #2f6b4a;
  --green-200: #d7efe0;
  --stone-100: #f7f6f3;
  --stone-200: #ebe7e0;
  --stone-600: #5b5b55;
  --white: #ffffff;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top left, #f4fbf6 0%, #f7f6f3 45%, #eef2ef 100%);
  color: var(--green-900);
  line-height: 1.6;
}

body.is-locked {
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

body.is-locked .app {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 45, 31, 0.7);
  display: grid;
  place-items: center;
  z-index: 999;
  padding: 20px;
}

body:not(.is-locked) .login-overlay {
  display: none;
}

.login-card {
  background: var(--white);
  padding: 28px;
  border-radius: 20px;
  width: min(420px, 90vw);
  box-shadow: 0 24px 50px rgba(15, 45, 31, 0.3);
  border: 1px solid rgba(15, 45, 31, 0.1);
}

.login-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--stone-600);
  margin-bottom: 8px;
}

.login-subtitle {
  color: var(--stone-600);
  margin-bottom: 16px;
}

#loginForm {
  display: grid;
  gap: 12px;
}

#loginForm label {
  font-weight: 600;
}

#loginForm input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stone-200);
  font-size: 1rem;
}

#loginForm button {
  background: var(--green-700);
  color: var(--white);
  border: none;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
}

#loginForm button:hover {
  background: var(--green-500);
}

.login-error {
  color: #b42318;
  min-height: 1.2em;
}

.sidebar {
  background: #0f2d1f;
  color: var(--white);
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  opacity: 0.7;
  margin-bottom: 8px;
}

.brand__title {
  font-size: 1.35rem;
  margin-bottom: 8px;
}

.brand__subtitle {
  font-size: 0.95rem;
  opacity: 0.8;
  margin-bottom: 20px;
}

.search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.nav {
  display: grid;
  gap: 12px;
}

.nav-section,
.nav-subsection {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 10px 6px;
}

.nav-section summary,
.nav-subsection summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  padding: 6px 6px 10px;
}

.nav-section summary::-webkit-details-marker,
.nav-subsection summary::-webkit-details-marker {
  display: none;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #e8f4ee;
  cursor: pointer;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

.nav-item.is-active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

.nav-item.is-hidden,
.nav-section.is-hidden,
.nav-subsection.is-hidden {
  display: none;
}

.content {
  padding: 32px 36px 80px;
}

.doc-section {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  padding: 28px;
  border-radius: 24px;
  box-shadow: 0 18px 36px rgba(15, 45, 31, 0.08);
  border: 1px solid rgba(15, 45, 31, 0.08);
  margin-bottom: 24px;
}

.doc-section.is-active {
  display: block;
}

.doc-section h2 {
  font-size: 1.75rem;
  margin-bottom: 12px;
}

.doc-section h3 {
  margin: 16px 0 8px;
  font-size: 1.1rem;
}

.doc-section ul,
.doc-section ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.stage-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stage-links {
  margin-top: 18px;
  padding: 16px;
  border-radius: 16px;
  background: var(--stone-100);
}

.stage-links h4 {
  margin-bottom: 8px;
}

.stage-links ul {
  margin-left: 18px;
}

.stage-router {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.stage-router select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stone-200);
  font-size: 1rem;
}

.stage-router__summary {
  font-weight: 600;
}

.stage-router__links {
  display: grid;
  gap: 10px;
}

.stage-router__links ul {
  margin-left: 18px;
}

.table-wrap {
  overflow-x: auto;
}

pre.message-block {
  white-space: pre-wrap;
  background: var(--stone-100);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--stone-200);
  margin-bottom: 12px;
  color: var(--green-700);
  font-family: "Segoe UI", system-ui, sans-serif;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--stone-200);
  padding: 10px;
  vertical-align: top;
}

th {
  background: var(--green-200);
  text-align: left;
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }
}
