:root {
  color-scheme:light;
  --bg:#f5f7fb;
  --surface:#fff;
  --sidebar:#101b30;
  --text:#17253d;
  --muted:#69768b;
  --border:#e4e9f1;
  --accent:#4263eb;
  --soft:#edf2ff;
  --green:#167b59;
  --red:#bb3744;
  --shadow:0 3px 12px #17253d04;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:14px;
}
:root[data-theme=dark] {
  color-scheme:dark;
  --bg:#101725;
  --surface:#182235;
  --sidebar:#0d1422;
  --text:#e3eaf7;
  --muted:#98a6bc;
  --border:#2a374d;
  --accent:#92a6ff;
  --soft:#243356;
  --green:#72d8b4;
  --red:#ff9ca6;
  --shadow:none;
}
@media(prefers-color-scheme:dark) {
  :root:not([data-theme=light]) {
    color-scheme:dark;
    --bg:#101725;
    --surface:#182235;
    --sidebar:#0d1422;
    --text:#e3eaf7;
    --muted:#98a6bc;
    --border:#2a374d;
    --accent:#92a6ff;
    --soft:#243356;
    --green:#72d8b4;
    --red:#ff9ca6;
    --shadow:none;
  }
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
}
a {
  color:var(--accent);
  text-decoration:none;
}
a:hover {
  text-decoration:underline;
}
button,input,select,textarea {
  font:inherit;
}
button,.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  border:1px solid var(--border);
  padding:.62rem 1rem;
  border-radius:7px;
  background:var(--surface);
  color:var(--text);
  cursor:pointer;
  line-height:1.4;
  text-decoration:none;
  white-space:nowrap;
}
button:hover,.button:hover {
  filter:brightness(.96);
  text-decoration:none;
}
.primary {
  background:#4263eb;
  color:white;
  border-color:#4263eb;
  font-weight:600;
}
.quiet {
  border-color:transparent;
  background:transparent;
  padding:.45rem .6rem;
  color:var(--muted);
}
.danger {
  color:var(--red);
  border-color:var(--red);
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline:3px solid var(--accent);
  outline-offset:3px;
}
.full {
  width:100%;
}
h1,h2,h3,p {
  margin-top:0;
}
h1 {
  font-size:30px;
  letter-spacing:-.9px;
  line-height:1.25;
  margin:8px 0 10px;
}
h2 {
  font-size:17px;
  letter-spacing:-.3px;
  margin-bottom:18px;
}
h3 {
  font-size:15px;
  margin-top:26px;
}
p {
  margin-bottom:14px;
}
.muted,small {
  color:var(--muted);
}
small {
  display:block;
  font-size:12px;
}
.strong {
  font-weight:600;
}
.mono {
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px;
}
.nowrap {
  white-space:nowrap;
}
.id-cell {
  max-width:150px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sidebar {
  position:fixed;
  inset:0 auto 0 0;
  width:244px;
  background:var(--sidebar);
  color:#aab6cc;
  padding:30px 18px;
  display:flex;
  flex-direction:column;
}
.brand {
  display:flex;
  gap:12px;
  align-items:center;
  color:#f4f7ff;
  font-size:28px;
  text-decoration:none;
  margin:0 12px 40px;
}
.brand span {
  font-size:18px;
  font-weight:650;
  letter-spacing:-.4px;
  line-height:1.5;
}
.brand small {
  font-size:8px;
  letter-spacing:1.7px;
  color:#8d9ab3;
}
.nav-label {
  font-size:10px;
  letter-spacing:1.8px;
  padding:0 14px 12px;
  font-weight:600;
}
nav {
  display:flex;
  flex-direction:column;
  gap:5px;
}
nav a {
  display:flex;
  align-items:center;
  gap:13px;
  padding:11px 14px;
  color:#aab6cc;
  border-radius:7px;
  font-size:17px;
}
nav a span {
  font-size:13px;
}
nav a:hover {
  background:#ffffff0a;
  text-decoration:none;
  color:#fff;
}
nav a[aria-current=page] {
  color:#fff;
  background:#4263eb;
}
.sidebar-footer {
  margin-top:auto;
  padding:25px 14px 0;
  border-top:1px solid #ffffff15;
}
.sidebar-footer p {
  font-size:11px;
  margin:13px 0 0;
}
.badge {
  display:inline-block;
  background:var(--soft);
  color:var(--accent);
  border-radius:4px;
  padding:4px 8px;
  font-size:9px;
  font-weight:700;
  letter-spacing:.7px;
}
.sidebar .badge {
  background:#263550;
  color:#aabcf7;
}
.workspace {
  margin-left:244px;
}
.topbar {
  min-height:78px;
  padding:16px 36px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:12px;
}
.header-actions {
  display:flex;
  align-items:center;
  gap:12px;
}
.header-actions form {
  margin:0;
}
.avatar {
  width:30px;
  height:30px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:var(--soft);
  color:var(--accent);
  font-weight:600;
}
main#main {
  max-width:1580px;
  padding:34px 36px;
  margin:auto;
}
.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  margin:0 0 26px;
}
.page-heading p {
  margin-bottom:0;
}
.eyebrow {
  font-size:10px;
  letter-spacing:1.8px;
  color:var(--muted);
  font-weight:700;
}
.card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:11px;
  padding:24px;
  box-shadow:var(--shadow);
  min-width:0;
}
.notice {
  display:flex;
  gap:15px;
  padding:19px 22px;
  background:var(--soft);
  color:var(--accent);
  border-radius:9px;
  margin-bottom:24px;
}
.notice>span {
  font-size:22px;
}
.notice strong {
  font-size:13px;
}
.notice p {
  font-size:12px;
  margin:3px 0 0;
}
.stats {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:18px;
  margin-bottom:24px;
}
.metric {
  padding:21px;
}
.metric>span {
  font-size:12px;
  color:var(--muted);
}
.metric>strong {
  display:block;
  font-size:35px;
  line-height:1.4;
  margin:10px 0;
}
.metric strong small {
  display:inline;
  font-size:14px;
  font-weight:400;
}
.metric>small {
  font-size:11px;
}
.dashboard-grid {
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(270px,1fr);
  gap:24px;
}
.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-bottom:16px;
}
.section-heading h2 {
  margin:0;
}
.section-heading>a {
  font-size:12px;
}
.step {
  display:flex;
  gap:14px;
  border-top:1px solid var(--border);
  padding:22px 0 5px;
}
.step b {
  font-size:11px;
  color:var(--accent);
  background:var(--soft);
  border-radius:6px;
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  flex-shrink:0;
}
.step a {
  font-size:13px;
  font-weight:600;
}
.step p {
  font-size:12px;
  color:var(--muted);
  margin-top:6px;
}
footer {
  display:flex;
  justify-content:space-between;
  font-size:11px;
  color:var(--muted);
  padding-top:28px;
  margin-top:10px;
}
.table-wrap {
  overflow:auto;
}
table {
  width:100%;
  border-collapse:collapse;
  text-align:left;
  font-size:12px;
}
th {
  font-size:10px;
  color:var(--muted);
  letter-spacing:.6px;
  text-transform:uppercase;
  font-weight:600;
  padding:12px 10px;
  background:var(--bg);
  white-space:nowrap;
}
td {
  padding:17px 10px;
  border-bottom:1px solid var(--border);
  overflow-wrap:anywhere;
}
tbody tr:last-child td {
  border:0;
}
td small {
  font-size:11px;
  margin-top:3px;
}
.pill {
  font-size:10px;
  border-radius:30px;
  padding:4px 9px;
  color:var(--muted);
  background:var(--bg);
  white-space:nowrap;
}
.pill.success {
  color:var(--green);
  background:var(--soft);
}
.pill.failure {
  color:var(--red);
  background:var(--bg);
}
.table-tools {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:20px;
}
.table-tools label {
  margin:0;
  font-size:11px;
}
.search-label {
  flex:1;
  max-width:460px;
}
.empty {
  text-align:center;
  padding:54px 18px;
  color:var(--muted);
}
.empty h2 {
  color:var(--text);
  margin:12px 0 8px;
}
.empty p {
  max-width:480px;
  margin:0 auto 20px;
}
.empty-icon {
  display:block;
  font-size:35px;
  color:var(--accent);
}
.form-card {
  max-width:920px;
}
label {
  display:block;
  font-size:12px;
  font-weight:500;
  margin-bottom:20px;
}
label input,label textarea,label select {
  display:block;
  margin-top:7px;
  width:100%;
}
input,textarea,select {
  background:var(--surface);
  color:var(--text);
  border:1px solid var(--border);
  border-radius:6px;
  padding:10px 12px;
  min-height:42px;
}
textarea {
  resize:vertical;
}
input::placeholder {
  color:var(--muted);
  opacity:.7;
}
.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 24px;
}
.actions {
  display:flex;
  gap:10px;
  align-items:center;
  margin-top:24px;
}
.check {
  display:flex;
  gap:10px;
  align-items:center;
}
.check input {
  width:16px;
  height:16px;
  min-height:0;
  margin:0;
  accent-color:#4263eb;
}
.check span {
  font-size:11px;
}
.assignment {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  border-top:1px solid var(--border);
  padding-top:15px;
}
.assignment>label {
  margin-bottom:12px;
}
.assignment select {
  padding:6px;
  min-height:34px;
}
fieldset {
  border:1px solid var(--border);
  border-radius:7px;
  padding:20px;
  margin:22px 0;
}
legend {
  font-size:13px;
  font-weight:600;
}
fieldset p {
  font-size:12px;
}
.details {
  display:grid;
  grid-template-columns:180px 1fr;
  gap:14px;
  font-size:13px;
  margin:28px 0;
}
.details dt {
  color:var(--muted);
}
.details dd {
  margin:0;
  overflow-wrap:anywhere;
}
.alert {
  background:var(--surface);
  color:var(--red);
  padding:16px;
  border:1px solid var(--red);
  border-radius:7px;
  margin-bottom:22px;
}
.auth {
  width:min(460px,100%);
  margin:8vh auto;
  padding:24px;
}
.auth .brand {
  color:var(--text);
  margin:0 0 35px;
  justify-content:center;
}
.auth .card {
  padding:32px;
}
.auth h1 {
  font-size:26px;
}
.auth>p {
  text-align:center;
  margin-top:24px;
  font-size:11px;
}
.auth .card>p {
  font-size:13px;
  color:var(--muted);
}
pre {
  padding:15px;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:6px;
  overflow:auto;
  font-size:12px;
}
dialog {
  color:var(--text);
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  padding:28px;
  max-width:min(460px,90vw);
}
dialog::backdrop {
  background:#07102288;
}
dialog p {
  color:var(--muted);
}
[hidden] {
  display:none!important;
}
@media(min-width:1700px) {
  main#main {
    padding-top:45px;
  }
}
@media(max-width:1150px) {
  .sidebar {
    width:210px;
    padding-left:10px;
    padding-right:10px;
  }
  .workspace {
    margin-left:210px;
  }
  .topbar {
    padding:14px 22px;
  }
  main#main {
    padding:28px 22px;
  }
  .stats {
    grid-template-columns:repeat(2,1fr);
  }
  .dashboard-grid {
    grid-template-columns:1fr;
  }
  .brand {
    gap:7px;
  }
  .brand span {
    font-size:16px;
  }
}
@media(max-width:700px) {
  .sidebar {
    position:static;
    width:auto;
    padding:15px;
    display:block;
  }
  .sidebar .brand {
    margin:0 0 12px;
  }
  .nav-label,.sidebar-footer {
    display:none;
  }
  nav {
    flex-direction:row;
    overflow:auto;
    padding-bottom:4px;
  }
  nav a {
    padding:8px 12px;
    white-space:nowrap;
  }
  nav a span {
    font-size:12px;
  }
  .workspace {
    margin:0;
  }
  .topbar {
    padding:12px 16px;
    min-height:62px;
  }
  .topbar>span {
    display:none;
  }
  .header-actions {
    width:100%;
    justify-content:flex-end;
    gap:8px;
  }
  main#main {
    padding:24px 16px;
  }
  .page-heading {
    align-items:flex-start;
    flex-direction:column;
    gap:16px;
  }
  h1 {
    font-size:27px;
  }
  .card {
    padding:18px;
  }
  .stats {
    gap:12px;
  }
  .metric {
    padding:16px;
  }
  .metric>strong {
    font-size:30px;
  }
  .metric>small {
    font-size:10px;
  }
  .form-grid {
    grid-template-columns:1fr;
  }
  .table-tools {
    flex-direction:column;
    align-items:stretch;
  }
  .details {
    grid-template-columns:1fr;
    gap:4px;
  }
  .details dd {
    margin-bottom:12px;
  }
  .assignment {
    flex-direction:column;
    align-items:stretch;
    gap:0;
  }
  .check {
    flex-wrap:wrap;
  }
  .assignment label {
    width:100%;
  }
  footer {
    gap:20px;
  }
  .auth {
    margin-top:2vh;
  }
  .auth .card {
    padding:24px;
  }
}
.agent-card { margin-top: 24px; }
.enrollment-token { display: block; overflow-wrap: anywhere; user-select: all; margin: 16px 0; }
.actions { flex-wrap: wrap; }
.discovery-tree { padding-left: 24px; }
details { border-top: 1px solid var(--border); padding: 16px 0; }
summary { cursor: pointer; overflow-wrap: anywhere; }
.editor-intro { margin-bottom:20px; }
.mode-tabs { display:flex; gap:10px; margin:20px 0; }
.code-editor { display:flex; border:1px solid var(--border); border-radius:8px; background:var(--bg); height:440px; overflow:hidden; }
.line-numbers { flex:0 0 48px; text-align:right; margin:0; padding:14px 8px; border:0; border-right:1px solid var(--border); border-radius:0; overflow:hidden; user-select:none; color:var(--muted); font:13px/1.65 ui-monospace,monospace; }
.code-stack { position:relative; flex:1; min-width:0; }
.code-stack pre,.code-stack textarea { position:absolute; inset:0; width:100%; height:100%; margin:0; padding:14px; border:0; border-radius:0; font:13px/1.65 ui-monospace,monospace; white-space:pre; tab-size:4; overflow:auto; }
.code-stack pre { pointer-events:none; color:var(--text); background:transparent; }
.code-stack textarea { resize:none; color:transparent; caret-color:var(--text); background:transparent; }
.code-stack textarea::selection { background:#4263eb44; }
.code-comment { color:var(--muted); }
.code-string { color:var(--green); }
.code-keyword { color:var(--accent); font-weight:600; }
.code-variable { color:var(--red); }
.config-preview { max-height:650px; overflow:auto; white-space:pre; font:12px/1.7 ui-monospace,monospace; }
.diagnostic { border-left:3px solid var(--border); padding:10px 14px; margin:10px 0; background:var(--bg); }
.diagnostic.error { border-color:var(--red); }
.diagnostic.warning { border-color:#bb8b21; }
.editor-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px; border:1px solid var(--border); border-radius:8px; padding:16px; margin:16px 0; }
.editor-row label { margin:0; }
@media(max-width:700px) { .code-editor { height:360px; } .line-numbers { flex-basis:36px; } .mode-tabs { flex-wrap:wrap; } }
