:root {
  --bg: #f1efe5;
  --card: #fffaf0;
  --ink: #1f231d;
  --muted: #5b5f57;
  --accent: #0e7a5f;
  --accent-strong: #075945;
  --danger: #9f2b2b;
  --line: #d8d3c6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, #d6f0e6, transparent 35%),
    radial-gradient(circle at 80% 0%, #fddcc2, transparent 25%),
    var(--bg);
}

.layout {
  width: min(1080px, 92vw);
  margin: 2.5rem auto 3rem;
  display: grid;
  gap: 1.1rem;
}

.hero {
  background: linear-gradient(130deg, #1f4f43, #2f2d62);
  color: #f5f5f2;
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.12);
}

.hero h1 {
  margin: 0.2rem 0 0.6rem;
  font-size: clamp(1.4rem, 2.5vw, 2.1rem);
}

.hero p {
  margin: 0;
  line-height: 1.35;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  opacity: 0.85;
  font-size: 0.8rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.grid-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field-title {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.6rem 0.75rem;
  background: #fff;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary {
  background: var(--accent);
  color: #fff;
  justify-self: start;
}

.primary:hover {
  background: var(--accent-strong);
}

.ghost {
  background: #ede8da;
  color: var(--ink);
}

.danger {
  background: #fbe8e8;
  color: var(--danger);
}

.feedback {
  min-height: 1.2rem;
  margin: 0;
  font-weight: 600;
}

.feedback.error {
  color: var(--danger);
}

.feedback.success {
  color: var(--accent-strong);
}

.catalog {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.catalog label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  background: #fff;
}

.instance-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.instance-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  display: grid;
  gap: 0.7rem;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.chip {
  border-radius: 999px;
  padding: 0.17rem 0.6rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03rem;
}

.chip.running {
  background: #d4f5db;
  color: #195f2f;
}

.chip.stopped,
.chip.exited {
  background: #f3e0e0;
  color: #7b1d1d;
}

.chip.degraded,
.chip.created,
.chip.paused,
.chip.restarting,
.chip.invalid {
  background: #f8efcf;
  color: #8a5a04;
}

.action-row,
.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.modules {
  display: grid;
  gap: 0.5rem;
}

.module-item {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 0.6rem;
  display: grid;
  gap: 0.45rem;
}

.module-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.add-module {
  display: flex;
  gap: 0.5rem;
}

.empty {
  color: var(--muted);
  margin: 0;
}

@media (max-width: 700px) {
  .layout {
    margin-top: 1.3rem;
  }

  .hero {
    padding: 1.1rem;
  }

  .panel-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }
}
