:root {
  --bg: #e9e4cf;
  --sidebar: #112f2e;
  --sidebar-card: #173b3a;
  --paper: #fffef9;
  --text: #1e2228;
  --muted: #5a647a;
  --accent: #0b8a84;
  --line: #d7d0ba;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: linear-gradient(120deg, #f1edd9 0%, #e6ecf2 100%);
}

.dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar) 0%, #1d4a49 100%);
  color: #eef8f7;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block h1 {
  margin: 4px 0 8px;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

.kicker {
  margin: 0;
  color: #67d8d3;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.sidebar-desc {
  margin: 0;
  color: #bedcd9;
  font-size: 0.88rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  text-decoration: none;
  color: #eaf6f4;
  padding: 10px 12px;
  border-radius: 9px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.nav-link:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  background: #f3f6f6;
  color: #173b3a;
  font-weight: 600;
}

.nav-link.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.side-foot {
  margin-top: auto;
  background: var(--sidebar-card);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: #c9e7e4;
}

.side-foot p {
  margin: 6px 0;
}

.workspace {
  padding: 26px;
}

.hero {
  margin-bottom: 14px;
}

.hero h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.desc {
  margin-top: 8px;
  color: var(--muted);
}

.desc.muted {
  margin: 0;
}

.views {
  display: block;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: fade-in 180ms ease;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.card,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(22, 33, 48, 0.08);
}

.panel {
  margin-bottom: 18px;
}

.panel h3 {
  margin: 0 0 12px;
  font-size: 1.95rem;
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.form-grid.compact {
  margin-bottom: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
  color: var(--muted);
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: #ffffff;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.actions.inline {
  margin-top: 24px;
}

.btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  cursor: pointer;
}

.btn-secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--text);
}

.btn-danger {
  border-color: #e38b7a;
  background: #fff5f3;
  color: var(--danger);
}

.btn-link {
  border-color: #c7d4e0;
  background: #f4f8fb;
  color: #2f4e67;
}

.status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.metric {
  margin-top: 10px;
  font-size: 1.8rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.84rem;
  word-break: break-all;
}

.empty {
  color: var(--muted);
  padding: 16px 8px;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
}

.pill-ok {
  background: #e6f7f2;
  color: #0b6b57;
}

.pill-off {
  background: #f3f4f6;
  color: #59616f;
}

.hidden {
  display: none;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .workspace {
    padding: 18px;
  }
}
