* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0a0a0a;
  color: #e5e5e5;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: #a78bfa; text-decoration: none; }
a:hover { color: #c4b5fd; }

code { font-family: inherit; color: #22c55e; }

/* ── Nav ── */
nav {
  border-bottom: 1px solid #222;
  background: #0a0a0a;
  position: sticky; top: 0; z-index: 50;
}
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  font-size: 1.1rem; font-weight: 800; color: #22c55e !important;
}
.nav-links { display: flex; gap: 18px; flex: 1; }
.nav-links a { color: #888; font-size: 0.9rem; }
.nav-links a:hover { color: #e5e5e5; }
.nav-user { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: #888; }

.link {
  background: none; border: none; color: #a78bfa;
  font-family: inherit; font-size: 0.85rem; cursor: pointer; padding: 0;
}
.link:hover { color: #c4b5fd; }

/* ── Main/pages ── */
main { max-width: 960px; margin: 0 auto; padding: 32px 24px 64px; }

.page section { margin-top: 28px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.page-head h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.page h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: #666; margin-bottom: 10px; }
.row-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.row-head h3 { margin-bottom: 0; }
.chip { font-size: 0.7rem; padding: 2px 8px; border: 1px solid #333; border-radius: 999px; color: #888; text-transform: uppercase; }
.muted { color: #888; }
.muted.small { font-size: 0.85rem; }

/* ── Auth ── */
.auth-card {
  max-width: 380px; margin: 64px auto; padding: 32px;
  border: 1px solid #222; border-radius: 12px; background: #111;
}
.brand-logo {
  font-size: 1.8rem; font-weight: 800; letter-spacing: -0.03em; color: #22c55e;
  text-align: center; margin-bottom: 6px;
}
.auth-card .muted { text-align: center; margin-bottom: 24px; font-size: 0.85rem; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; color: #888; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 0.85rem; color: #888; }

input, textarea, select {
  background: #0a0a0a; border: 1px solid #333; color: #e5e5e5;
  padding: 10px 12px; font-family: inherit; font-size: 0.9rem;
  border-radius: 6px;
}
input:focus { outline: none; border-color: #a78bfa; }

button {
  background: #22c55e; color: #000; border: none;
  padding: 10px 18px; border-radius: 6px;
  font-family: inherit; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; text-transform: lowercase;
}
button:hover:not(:disabled) { background: #16a34a; }
button:disabled { opacity: 0.5; cursor: default; }
button.small { padding: 6px 12px; font-size: 0.75rem; }
button.danger { background: #ef4444; color: #fff; }
button.danger:hover:not(:disabled) { background: #dc2626; }
button.ghost { background: transparent; border: 1px solid #333; color: #e5e5e5; }
button.ghost:hover:not(:disabled) { background: #1a1a1a; }

.form-err { color: #ef4444; font-size: 0.8rem; min-height: 1.2em; }

/* ── Lists / cards ── */
.list { display: flex; flex-direction: column; gap: 8px; }
.card {
  padding: 14px 16px; border: 1px solid #222; border-radius: 8px; background: #111;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-main { flex: 1; min-width: 0; }
.card-title { font-weight: 600; font-size: 0.95rem; }
.card-sub { font-size: 0.8rem; color: #888; margin-top: 2px; }
.card-actions { display: flex; gap: 8px; }
.card a.card-title { color: #e5e5e5; }
.card a.card-title:hover { color: #a78bfa; }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-online { background: #22c55e; }
.status-offline { background: #666; }
.status-busy { background: #eab308; }
.status-exhausted { background: #ef4444; }

.empty {
  padding: 32px; border: 1px dashed #333; border-radius: 8px;
  text-align: center; color: #666; font-size: 0.9rem;
}

/* ── Key/value blocks ── */
.kv { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: #ccc; }
.kv code { word-break: break-all; }
.mono-wrap {
  display: block; word-break: break-all; white-space: pre-wrap;
  background: #050505; border: 1px solid #222; border-radius: 6px;
  padding: 10px 12px; font-size: 0.75rem; color: #88ccaa;
}
.code-block {
  background: #050505; border: 1px solid #222; border-radius: 6px;
  padding: 12px 14px; font-size: 0.78rem; color: #ccc;
  overflow-x: auto; white-space: pre;
}

.tool-list { list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: #aaa; }
.tool-list li { padding: 8px 12px; background: #111; border: 1px solid #222; border-radius: 6px; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #111; border: 1px solid #222; border-radius: 12px;
  padding: 24px; max-width: 480px; width: 100%;
}
.modal h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; color: #e5e5e5; text-transform: none; letter-spacing: 0; }
.modal form { display: flex; flex-direction: column; gap: 12px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #111; border: 1px solid #22c55e; border-radius: 8px;
  padding: 12px 16px; font-size: 0.85rem; color: #e5e5e5;
  z-index: 200; animation: slideIn 0.2s ease;
}
.toast.error { border-color: #ef4444; color: #fca5a5; }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (max-width: 640px) {
  .nav-inner { flex-wrap: wrap; gap: 12px; }
  .nav-links { order: 3; width: 100%; }
  .nav-user { margin-left: auto; }
  main { padding: 20px 16px 48px; }
}
