:root {
  --bg: #0c0d12;
  --bg-card: #15161f;
  --bg-card-2: #1b1d28;
  --line: #262838;
  --text: #e7e9f0;
  --muted: #8a8fa3;
  --accent: #6d8bff;
  --accent-2: #a06dff;
  --green: #34d399;
  --amber: #fbbf24;
  --gray: #4b4f63;
  --red: #f87171;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --sans: -apple-system, "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(109,139,255,.10), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(160,109,255,.08), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; backdrop-filter: blur(8px);
  background: rgba(12,13,18,.7); z-index: 10;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  font-size: 30px; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar h1 { margin: 0; font-size: 18px; letter-spacing: 3px; }
.tagline { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.clock { font-family: var(--mono); font-size: 12px; color: var(--muted); }

main { padding: 26px; max-width: 1180px; margin: 0 auto; }
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.card {
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: #34384e; transform: translateY(-2px); }

.card-head { display: flex; align-items: center; gap: 12px; }
.icon { font-size: 26px; }
.titles { flex: 1; min-width: 0; }
.name { margin: 0; font-size: 16px; }
.cat {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); border: 1px solid var(--line);
  padding: 1px 7px; border-radius: 20px;
}
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--gray); flex: none; box-shadow: 0 0 0 4px transparent; }
.dot.running { background: var(--green); box-shadow: 0 0 0 4px rgba(52,211,153,.15); }
.dot.busy { background: var(--amber); box-shadow: 0 0 0 4px rgba(251,191,36,.15); animation: pulse 1.1s infinite; }
.dot.stopped, .dot.idle { background: var(--gray); }
.dot.link { background: var(--accent); }
@keyframes pulse { 50% { opacity: .35; } }

.desc { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

.deps { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; font-family: var(--mono); padding: 2px 8px;
  border-radius: 20px; border: 1px solid var(--line);
}
.chip.ok { color: var(--green); border-color: rgba(52,211,153,.35); }
.chip.bad { color: var(--amber); border-color: rgba(251,191,36,.35); cursor: help; }

.form { display: grid; gap: 8px; }
.field { display: grid; gap: 3px; }
.field label { font-size: 11px; color: var(--muted); }
.field input, .field select {
  background: #0e0f16; border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 8px 10px; font-size: 13px; font-family: var(--sans);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
button {
  cursor: pointer; border: none; border-radius: 10px; font-size: 13px;
  font-weight: 600; padding: 9px 15px; font-family: var(--sans);
  transition: filter .12s, background .12s;
}
button:hover { filter: brightness(1.12); }
button:active { transform: translateY(1px); }
.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; flex: 1; }
.success { background: var(--green); color: #06281c; }
.danger { background: #2a1a1f; color: var(--red); border: 1px solid rgba(248,113,113,.3); }
.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.ghost:hover { color: var(--text); }

.meta { font-size: 11px; color: var(--muted); font-family: var(--mono); min-height: 14px; }

.console {
  background: #07080c; border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden;
}
.console-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; font-size: 11px; color: var(--muted);
  border-bottom: 1px solid var(--line); font-family: var(--mono);
}
.console-close { padding: 2px 8px; font-size: 11px; }
.log {
  margin: 0; padding: 10px; max-height: 240px; overflow: auto;
  font-family: var(--mono); font-size: 12px; line-height: 1.5;
  color: #c5cbe0; white-space: pre-wrap; word-break: break-word;
}

.outbox {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px;
  background: #0e0f16; font-size: 12px;
}
.outbox h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.outbox table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.outbox th, .outbox td {
  text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.outbox th { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .5px; }
.outbox td { color: #cdd2e6; }
.outbox td:first-child { font-family: var(--mono); }

.hidden { display: none; }
