:root{
  --bg:#0b0f17;
  --panel:#121826;
  --panel2:#0f1522;
  --text:#e9eef8;
  --muted:#a9b6cc;
  --stroke:rgba(255,255,255,.10);
  --shadow:0 10px 30px rgba(0,0,0,.45);
  --radius:18px;
  --radius2:22px;
  --accent:#8ab4ff;
  --bad:#ff7a7a;
  --good:#7ee2b8;
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(122,162,255,.18), transparent 60%),
    radial-gradient(900px 500px at 90% 10%, rgba(112,214,164,.14), transparent 55%),
    var(--bg);
  color:var(--text);
  min-height:100vh;
  padding:24px;
}

header{
  max-width:1100px;
  margin:0 auto 18px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}

.title{ display:flex; flex-direction:column; gap:4px; }
h1{ margin:0; font-size:20px; letter-spacing:.2px; }
.sub{ margin:0; color:var(--muted); font-size:13px; }

.actions{ display:flex; gap:10px; flex-wrap:wrap; }

button{
  border:1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  box-shadow: var(--shadow);
  font-weight:600;
  font-size:13px;
}
button:hover{ border-color: rgba(255,255,255,.18); }
button.primary{
  border-color: rgba(138,180,255,.35);
  background: linear-gradient(180deg, rgba(138,180,255,.20), rgba(138,180,255,.06));
}
button.danger{
  border-color: rgba(255,122,122,.35);
  background: linear-gradient(180deg, rgba(255,122,122,.18), rgba(255,122,122,.05));
}

.wrap{
  max-width:1100px;
  margin:0 auto;
  background: rgba(18,24,38,.72);
  border:1px solid var(--stroke);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.toolbar{
  padding:14px 16px;
  border-bottom:1px solid var(--stroke);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background: rgba(15,21,34,.55);
}

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

.pill{
  font-size:12px;
  color:var(--muted);
  border:1px solid var(--stroke);
  padding:6px 10px;
  border-radius:999px;
  background: rgba(0,0,0,.15);
}

.tree{
  padding:18px 16px 24px;
  overflow:auto;
}

ul.tree-list{
  list-style:none;
  margin:0;
  padding-left:18px;
  position:relative;
}
ul.tree-list:before{
  content:"";
  position:absolute;
  top:0;
  left:8px;
  bottom:0;
  width:1px;
  background: rgba(255,255,255,.08);
}
li.node{
  margin:10px 0;
  padding-left:14px;
  position:relative;
}
li.node:before{
  content:"";
  position:absolute;
  top:14px;
  left:0;
  width:14px;
  height:1px;
  background: rgba(255,255,255,.08);
}

.card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: 0 6px 18px rgba(0,0,0,.30);
  min-width: 220px;
  max-width: 520px;
}
.card.clickable{ cursor:pointer; }
.card.clickable:hover{ border-color: rgba(255,255,255,.18); }

.name{
  font-weight:700;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 260px;
}
.meta{
  margin-left:auto;
  display:flex;
  gap:8px;
  align-items:center;
  color:var(--muted);
  font-size:12px;
}
.badge{
  border:1px solid var(--stroke);
  padding:4px 8px;
  border-radius:999px;
  background: rgba(0,0,0,.18);
}
.badge.good{
  border:1px solid rgba(126,226,184,.22);
  background: rgba(126,226,184,.08);
  color: rgba(126,226,184,.95);
}

.tiny{ font-size:12px; color:var(--muted); line-height:1.35; }

.field-title{
  font-size:12px;
  color:var(--muted);
  margin:0 0 6px 0;
  font-weight:600;
  letter-spacing:.2px;
}

/* Modal */
.backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:50;
}
.backdrop.show{ display:flex; }

.modal{
  width:min(760px, 100%);
  background: rgba(18,24,38,.95);
  border:1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow:hidden;
}

.modal header{
  margin:0;
  padding:14px 16px;
  border-bottom:1px solid var(--stroke);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  background: rgba(15,21,34,.55);
  max-width:none;
}
.modal h2{ margin:0; font-size:15px; letter-spacing:.2px; }

.modal .content{
  padding:14px 16px 18px;
  display:grid;
  gap:12px;
}

label{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-bottom:6px;
}
input, textarea, select{
  width:100%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
  font-size:13px;
}
textarea{ min-height: 90px; resize: vertical; }

.row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
@media (max-width: 720px){
  .row{ grid-template-columns:1fr; }
}

.modal .footer{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:14px 16px;
  border-top:1px solid var(--stroke);
  background: rgba(15,21,34,.55);
  flex-wrap:wrap;
}

.urls{ display:grid; gap:8px; }
.url-item{ display:flex; gap:8px; align-items:center; }
.url-item input{ flex:1; }
.url-item a{
  color: var(--accent);
  text-decoration:none;
  font-size:12px;
  white-space:nowrap;
}
.url-item a:hover{ text-decoration:underline; }

.notice{
  font-size:12px;
  color: rgba(255,122,122,.95);
  background: rgba(255,122,122,.10);
  border:1px solid rgba(255,122,122,.25);
  padding:10px 12px;
  border-radius: 14px;
  display:none;
}
.notice.show{ display:block; }
