:root {
  --bg: #0b1210;
  --bg-panel: #121a17;
  --bg-elevated: #18211d;
  --line: #2a3a33;
  --text: #e7efe9;
  --muted: #8fa399;
  --accent: #3d9b6a;
  --accent-soft: rgba(61, 155, 106, 0.14);
  --online: #4ecf8a;
  --standby: #7eb6ff;
  --offline: #ff8f8f;
  --radius: 10px;
  --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Consolas", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61, 155, 106, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(40, 80, 60, 0.18), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
}

a { color: #7dcea5; text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 56px;
}

header {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(145deg, #2f7a52, #1d4a34);
  border: 1px solid #4aa874;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
  position: relative;
}

.mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid #b8f0d0;
  border-radius: 3px;
  transform: rotate(45deg);
  opacity: 0.85;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: 0.02em;
  font-weight: 700;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.crumbs a { color: #9fd9bb; }
.crumbs .sep { opacity: 0.5; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
  background: var(--bg-elevated);
}

.status-grid,
.projects,
.list,
.agent-grid {
  display: grid;
  gap: 12px;
}

.status-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 28px;
}

.projects {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.stat,
.card,
.panel,
.row {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat {
  padding: 14px 16px;
  min-height: 86px;
}

.stat.clickable,
.card.clickable,
.row.clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  color: inherit;
  text-decoration: none;
  display: block;
}

.stat.clickable:hover,
.card.clickable:hover,
.row.clickable:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  text-decoration: none;
}

.stat .label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat .value {
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--online);
  font-size: 0.92rem;
  border: 1px solid rgba(61, 155, 106, 0.35);
}

.pill.standby {
  color: var(--standby);
  background: rgba(126, 182, 255, 0.12);
  border-color: rgba(126, 182, 255, 0.35);
}

.pill.offline {
  color: var(--offline);
  background: rgba(255, 143, 143, 0.1);
  border-color: rgba(255, 143, 143, 0.35);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(78, 207, 138, 0.18);
}

.pill.standby .dot { box-shadow: 0 0 0 3px rgba(126, 182, 255, 0.18); }
.pill.offline .dot { box-shadow: 0 0 0 3px rgba(255, 143, 143, 0.18); }

section h2,
.panel h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.card {
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-panel));
  padding: 18px 16px;
  min-height: 110px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}

.card .name {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 8px;
}

.card .meta {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}

.panel {
  padding: 18px;
  margin-bottom: 14px;
}

.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 14px;
  margin: 0;
}

.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.row {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr 0.9fr;
  gap: 10px;
  align-items: center;
}

.row .muted,
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 0.9rem; }

.pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.5;
  background: #0a0f0d;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 0;
}

footer {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.error {
  color: #ff8f8f;
  border: 1px solid rgba(255, 143, 143, 0.35);
  background: rgba(255, 80, 80, 0.08);
  padding: 12px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: none;
}

.empty {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

@media (max-width: 800px) {
  .row {
    grid-template-columns: 1fr;
  }
  .kv {
    grid-template-columns: 1fr;
  }
  .shell { padding: 24px 16px 40px; }
}
