:root {
  --bg: #0b1220;
  --panel: rgba(20, 32, 52, 0.86);
  --panel-2: rgba(16, 26, 42, 0.78);
  --line: rgba(150, 190, 220, 0.25);
  --text: #eaf3ff;
  --muted: #9fb3c8;
  --accent: #63e6be;
  --accent-2: #ffd43b;
  --danger: #ff6b6b;
  --ok: #51cf66;
  --radius: 16px;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 18% 8%, rgba(99, 230, 190, 0.14), transparent 42%),
    radial-gradient(circle at 90% 12%, rgba(255, 212, 59, 0.12), transparent 46%),
    linear-gradient(180deg, #060a14, #0b1220 55%, #0c1730);
}

a { color: inherit; }

.shell {
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: 22px 0 60px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(8, 14, 26, 0.88);
  border-bottom: 1px solid rgba(150, 190, 220, 0.18);
}

.topbar-inner {
  width: min(1180px, 94vw);
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px rgba(99, 230, 190, 0.12);
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav a, .nav button {
  border: 1px solid var(--line);
  background: rgba(12, 20, 34, 0.78);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.nav a.active { border-color: rgba(99, 230, 190, 0.6); }

.grid {
  display: grid;
  gap: 12px;
}

.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 980px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  opacity: 0.32;
  background:
    radial-gradient(circle at 12% 18%, rgba(99, 230, 190, 0.16), transparent 46%),
    radial-gradient(circle at 82% 18%, rgba(255, 212, 59, 0.13), transparent 52%);
}

.card > * { position: relative; }

h1, h2, h3 { margin: 0.2rem 0 0.7rem; }
p { margin: 0.35rem 0; color: var(--muted); }

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 31, 0.82);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.pill.primary {
  border-color: rgba(99, 230, 190, 0.65);
  background: rgba(99, 230, 190, 0.12);
}

.pill.danger {
  border-color: rgba(255, 107, 107, 0.55);
  background: rgba(255, 107, 107, 0.12);
}

label { display: block; font-weight: 700; margin: 10px 0 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(150, 190, 220, 0.28);
  background: rgba(7, 12, 22, 0.6);
  color: var(--text);
  outline: none;
}
textarea { min-height: 120px; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(159, 179, 200, 0.7); }

.hint { font-size: 0.9rem; color: var(--muted); }
.mono { font-family: var(--mono); }
.err { color: #ffd8d8; background: rgba(255, 107, 107, 0.16); border: 1px solid rgba(255, 107, 107, 0.35); padding: 10px 12px; border-radius: 12px; }
.ok { color: #d7ffe4; background: rgba(81, 207, 102, 0.12); border: 1px solid rgba(81, 207, 102, 0.28); padding: 10px 12px; border-radius: 12px; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 14px;
}
th, td {
  border-bottom: 1px solid rgba(150, 190, 220, 0.16);
  padding: 10px 10px;
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 800; font-size: 0.86rem; }
tr:hover td { background: rgba(255, 255, 255, 0.03); }

.tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(150, 190, 220, 0.25);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(10, 18, 31, 0.55);
}
.tag.ok { border-color: rgba(81, 207, 102, 0.35); color: #c9ffd6; }
.tag.bad { border-color: rgba(255, 107, 107, 0.35); color: #ffd8d8; }
.tag.warn { border-color: rgba(255, 212, 59, 0.35); color: #fff3bf; }

.chatlog {
  border: 1px solid rgba(150, 190, 220, 0.22);
  border-radius: 12px;
  background: rgba(7, 12, 22, 0.45);
  padding: 10px 12px;
  min-height: 140px;
  max-height: 360px;
  overflow: auto;
}

.chatmsg { margin: 0 0 12px; }
.chatwho { font-weight: 900; letter-spacing: 0.01em; color: var(--muted); }
.chatmsg.user .chatwho { color: var(--accent); }
.chatmsg.assistant .chatwho { color: var(--accent-2); }
.chatbody { margin-top: 4px; white-space: pre-wrap; color: var(--text); }
