:root {
  --bg0: #0f1412;
  --bg1: #17201c;
  --bg2: #1f2b26;
  --line: #2d3d36;
  --text: #e7efe9;
  --muted: #9bb0a5;
  --accent: #3dba84;
  --accent-2: #d7b56d;
  --danger: #e36b6b;
  --ok: #3dba84;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 186, 132, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(215, 181, 109, 0.12), transparent 50%),
    linear-gradient(160deg, var(--bg0), #121916 45%, #0c100e);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--accent-2); }

.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  padding: 1.25rem 1rem 2rem;
  border-right: 1px solid var(--line);
  background: rgba(15, 20, 18, 0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1.5rem; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), #1f7a55);
  font-weight: 700; letter-spacing: 0.04em;
}
.brand strong { display: block; font-size: 0.95rem; }
.brand small { color: var(--muted); }
.sidebar nav { display: grid; gap: 0.25rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.55rem 0.7rem; border-radius: 10px; color: var(--text);
  text-decoration: none;
}
.sidebar nav a:hover, .sidebar nav a.active {
  background: var(--bg2); text-decoration: none;
}
.sidebar nav a.active { outline: 1px solid rgba(61, 186, 132, 0.35); }
.sidebar-note {
  margin-top: 1.5rem; color: var(--muted); font-size: 0.8rem; line-height: 1.4;
}

.main { padding: 1.5rem 1.75rem 3rem; }
.hero-panel, .panel {
  background: linear-gradient(180deg, rgba(31, 43, 38, 0.92), rgba(23, 32, 28, 0.92));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.hero-panel h1, .panel h1, .panel h2 { margin: 0 0 0.4rem; }
.hero-panel p, .muted { color: var(--muted); }
.cta-row { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 999px;
  padding: 0.55rem 1rem; font-weight: 600; cursor: pointer;
  text-decoration: none; font-family: inherit;
}
.btn.primary { background: var(--accent); color: #062316; }
.btn.primary:hover { filter: brightness(1.05); text-decoration: none; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); text-decoration: none; }

.stat-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid article {
  background: rgba(23, 32, 28, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
.stat-grid span { color: var(--muted); font-size: 0.8rem; }
.stat-grid strong { display: block; font-size: 1.5rem; margin-top: 0.2rem; }

.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.panel.narrow { max-width: 720px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }

.pill {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  background: rgba(155, 176, 165, 0.15); border: 1px solid var(--line);
  font-size: 0.75rem; text-transform: lowercase;
}
.pill.ok { color: var(--ok); border-color: rgba(61, 186, 132, 0.4); }

.form { display: grid; gap: 0.85rem; margin-top: 1rem; }
.form.grid-2 { grid-template-columns: 1fr 1fr; }
.form label { display: grid; gap: 0.35rem; font-size: 0.9rem; }
.form label.full { grid-column: 1 / -1; }
.form label.check { display: flex; align-items: center; gap: 0.5rem; }
.form input, .form select, .form textarea {
  width: 100%; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg0); color: var(--text); padding: 0.65rem 0.75rem;
  font: inherit;
}
.form textarea { font-family: var(--mono); font-size: 0.85rem; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.step {
  border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 0.9rem;
  background: rgba(15, 20, 18, 0.55);
}
.step > div { display: flex; justify-content: space-between; gap: 0.75rem; align-items: center; }
.step p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.9rem; }
.step-ok { border-color: rgba(61, 186, 132, 0.45); }
.step-failed { border-color: rgba(227, 107, 107, 0.55); }
.step-running { border-color: rgba(215, 181, 109, 0.55); }
.step-skipped { opacity: 0.85; }

.flash {
  margin-bottom: 0.9rem; padding: 0.7rem 0.9rem; border-radius: 12px;
  border: 1px solid var(--line);
}
.flash-success { background: rgba(61, 186, 132, 0.12); border-color: rgba(61, 186, 132, 0.4); }
.flash-danger { background: rgba(227, 107, 107, 0.12); border-color: rgba(227, 107, 107, 0.45); }

.link-list { margin: 0.75rem 0 0; padding-left: 1.1rem; line-height: 1.7; }
.prose h1, .prose h2, .prose h3 { margin: 1rem 0 0.4rem; }
.code-block {
  white-space: pre-wrap; font-family: var(--mono); font-size: 0.82rem;
  background: var(--bg0); border: 1px solid var(--line); border-radius: 10px; padding: 0.85rem;
  overflow-x: auto;
}

.sidebar-user {
  margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 0.5rem; align-items: center;
  font-size: 0.85rem;
}

.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
}
.auth-shell { width: min(420px, 100%); }
.auth-card { margin: 0; }
.auth-brand { margin-bottom: 1rem; }
.auth-foot { text-align: center; margin-top: 1rem; font-size: 0.85rem; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form.grid-2 { grid-template-columns: 1fr; }
}
