:root {
  --bg: #0b0f19;
  --panel: rgba(255, 255, 255, 0.04);
  --panel2: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.12);
  --text: rgba(230, 233, 242, 0.92);
  --muted: rgba(230, 233, 242, 0.70);
  --muted2: rgba(230, 233, 242, 0.55);
  --link: #c9d4ff;
  --shadow: rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --ok: rgba(115, 255, 196, 0.22);
  --warn: rgba(255, 215, 115, 0.20);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 212, 255, 0.35);
}
a:hover { border-bottom-color: rgba(201, 212, 255, 0.9); }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 1.6fr;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  cursor: pointer;
}
.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.name { font-size: 16px; font-weight: 800; }
.tagline { font-size: 12px; color: var(--muted); }

.searchwrap { width: 100%; }
.search {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  outline: none;
}
.search::placeholder { color: rgba(230, 233, 242, 0.45); }
.search:focus { border-color: rgba(201, 212, 255, 0.55); }

.rightbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Nav */
.nav {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.navbtn {
  padding: 9px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.navbtn.active { border-color: rgba(201, 212, 255, 0.55); }

/* Buttons */
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  padding: 9px 11px;
  border-radius: 999px;
  border: 1px solid rgba(201, 212, 255, 0.35);
  background: rgba(201, 212, 255, 0.10);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(201, 212, 255, 0.75); }
.btn.ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border);
}
.btn.small { padding: 7px 9px; font-size: 12px; }

.iconbtn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}
.iconbtn:hover { border-color: rgba(201, 212, 255, 0.55); }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 1280px;
  margin: 0 auto;
}

.sidebar {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

.sidehead {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.sidetitle { font-size: 14px; font-weight: 800; }
.sidesub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.tree {
  padding: 10px;
  overflow: auto;
  flex: 1;
}

.sidefoot {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  color: var(--muted2);
  font-size: 12px;
}

.node {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid transparent;
}
.node:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.10);
}
.node.active {
  border-color: rgba(201, 212, 255, 0.55);
  background: rgba(201, 212, 255, 0.06);
}

.indent { margin-left: 14px; border-left: 1px solid rgba(255,255,255,0.08); padding-left: 10px; }
.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
}
.nlabel { font-size: 13px; }
.nmeta { margin-left: auto; display: flex; gap: 6px; align-items: center; color: var(--muted2); font-size: 12px; }

.content {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px var(--shadow);
  overflow: hidden;
}

.contentinner { padding: 18px; }
.h1 { font-size: 22px; font-weight: 900; letter-spacing: -0.01em; margin: 0 0 8px; }
.p { margin: 0 0 12px; color: var(--muted); line-height: 1.6; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 14px;
}
@media (min-width: 900px) {
  .grid.cols2 { grid-template-columns: 1fr 1fr; }
  .grid.cols3 { grid-template-columns: 1fr 1fr 1fr; }
}

.card {
  border: 1px solid rgba(255,255,255,0.14);
  background: var(--panel2);
  border-radius: 14px;
  padding: 14px;
}
.ctitle { font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted2); margin-bottom: 10px; }
.big { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.small { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.kv { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.kv span { font-size: 12px; color: var(--muted); border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.02); padding: 6px 8px; border-radius: 999px; }

.list { margin: 10px 0 0; padding-left: 18px; color: var(--muted); }
.list li { margin: 6px 0; }

.hr { height: 1px; background: rgba(255,255,255,0.10); margin: 12px 0; }

.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 18px 22px;
  color: var(--muted2);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Modal */
.modalback {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modalback.show { display: flex; }
.modal {
  width: 100%;
  max-width: 560px;
  border: 1px solid var(--border);
  background: rgba(11, 15, 25, 0.96);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6);
  overflow: hidden;
}
.modalhead {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.modaltitle { font-weight: 900; }
.modalbody { padding: 14px; color: var(--muted); line-height: 1.6; }
.modalfoot {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.field {
  width: 100%;
  margin: 10px 0;
}
.field label { display: block; font-size: 12px; color: var(--muted2); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 11px;
  outline: none;
}
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: rgba(201, 212, 255, 0.55); }

/* Toast */
.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  max-width: 360px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(11, 15, 25, 0.95);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  display: none;
}
.toast.show { display: block; }
.toast .t { font-weight: 800; margin-bottom: 2px; }
.toast .d { color: var(--muted); font-size: 13px; line-height: 1.4; }
