:root{
  --bg1:#070a12;
  --glass: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.12);
  --text: #fff;
  --shadow: 0 24px 60px rgba(0,0,0,.45);
  --r: 18px;
  --r2: 14px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 18% 8%, rgba(99,102,241,0.22), transparent 62%),
    radial-gradient(900px 500px at 82% 18%, rgba(16,185,129,0.16), transparent 58%),
    radial-gradient(1000px 700px at 65% 95%, rgba(244,63,94,0.12), transparent 65%),
    var(--bg1);
}
code{background:rgba(255,255,255,.08); padding:2px 6px; border-radius:8px; border:1px solid rgba(255,255,255,.12)}

.topbar{
  position: sticky; top:0; z-index: 30;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 16px;
  backdrop-filter: blur(16px);
  background: rgba(0,0,0,.28);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.brand{display:flex; gap:12px; align-items:center}
.logo{width:38px; height:38px; display:grid; place-items:center; border-radius:14px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12)}
.title{font-weight:800; letter-spacing:.2px}
.subtitle{font-size:12px; color:rgba(255,255,255,.55)}
.topbar-right{display:flex; gap:10px; align-items:center}
.pill{font-size:12px; padding:6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.06); color:rgba(255,255,255,.85)}

.layout{
  max-width: 1260px;
  margin: 0 auto;
  padding: 18px 16px 34px;
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
}
@media (max-width: 1050px){
  .layout{grid-template-columns: 1fr}
  .sidebar{position:relative !important; top:auto !important}
}

.sidebar{position: sticky; top: 76px; align-self: start}
.main{min-height: 70vh}

.card{
  border-radius: var(--r);
  border:1px solid rgba(255,255,255,.10);
  background: var(--glass);
  box-shadow: var(--shadow);
}
.card.small{padding:12px}
.card.inner{padding:14px; background:rgba(255,255,255,.05)}
.card-h{
  padding: 14px 14px 10px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
}
.h{font-size:16px; font-weight:800}
.p{font-size:13px; color:rgba(255,255,255,.65); margin-top:4px}
.h2{font-size:14px; font-weight:800}
.h3{font-size:13px; font-weight:800; margin-top:10px}
.sep{height:1px; background:rgba(255,255,255,.10); margin:12px 0}

.nav{padding: 0 10px 12px}
.nav-item{
  width:100%;
  padding:10px 10px;
  border-radius: 14px;
  border:1px solid transparent;
  background: transparent;
  color:rgba(255,255,255,.85);
  text-align:left;
  cursor:pointer;
}
.nav-item:hover{background: rgba(255,255,255,.06)}
.nav-item.active{background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.10)}

.field{padding: 0 14px 12px}
.field.row{padding-top:6px}
.label{font-size:12px; color:rgba(255,255,255,.70); margin:0 0 6px}
.help{font-size:12px; color:rgba(255,255,255,.55); margin-top:6px}
.input{
  width:100%;
  height:42px;
  padding: 0 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color:#fff;
  outline:none;
}
textarea.input{height:auto; padding:10px 12px; resize:vertical}
.input:focus{box-shadow: 0 0 0 3px rgba(255,255,255,.12)}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:12px; padding: 0 14px 12px}
@media (max-width: 820px){.grid2{grid-template-columns:1fr}}

.btn{
  height:42px;
  padding:0 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.12);
  background: #fff;
  color:#000;
  font-weight:800;
  cursor:pointer;
}
.btn:hover{filter:brightness(.96)}
.btn.secondary{background: rgba(255,255,255,.10); color:#fff}
.btn.ghost{background: transparent; color:#fff}
.btn.danger{background: rgba(239,68,68,.16); color: #ffd7d7; border-color: rgba(239,68,68,.35)}
.btn:disabled{opacity:.55; cursor:not-allowed}

.ul{margin:8px 0 0 18px; color:rgba(255,255,255,.70); font-size:12px}
.ol{margin:8px 0 0 18px; color:rgba(255,255,255,.75); font-size:13px; line-height:1.5}
.infoBox{padding: 14px; border-radius: var(--r2); border: 1px dashed rgba(255,255,255,.16); background: rgba(0,0,0,.18)}

.stats{padding: 0 14px 14px; display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
@media (max-width: 900px){.stats{grid-template-columns:1fr}}
.stat{
  border-radius: var(--r2);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  padding: 14px;
}
.stat .k{font-size:12px; color:rgba(255,255,255,.60)}
.stat .v{font-size:28px; font-weight:900; margin-top:2px}

.gridMembers{display:grid; grid-template-columns: 1.2fr .8fr; gap: 14px}
@media (max-width: 1100px){.gridMembers{grid-template-columns:1fr}}
.list{padding: 0 14px 14px; display:flex; flex-direction:column; gap:10px}
.list.small{padding-top:6px}
.item{
  border-radius: var(--r2);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  padding: 12px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
}
.item .meta{display:flex; gap:10px; align-items:flex-start}
.avatar{
  width:42px; height:42px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.10);
  overflow:hidden;
  display:grid; place-items:center;
  font-weight:900;
}
.avatar img{width:100%; height:100%; object-fit:cover}
.item .name{font-weight:900}
.item .sub{font-size:12px; color:rgba(255,255,255,.65); margin-top:3px; display:flex; flex-wrap:wrap; gap:8px}
.item .act{display:flex; gap:8px; flex-wrap:wrap}

.switch{display:flex; align-items:center; gap:10px; font-size:12px; color:rgba(255,255,255,.78)}
.switch input{transform: scale(1.05)}

#toastHost{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 99;
  display:flex;
  flex-direction:column;
  gap: 10px;
  width: 340px;
  max-width: calc(100vw - 32px);
}
.toast{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(12px);
  padding: 12px;
  box-shadow: 0 18px 44px rgba(0,0,0,.55);
}
.toast .t{font-weight:900; font-size:13px}
.toast .d{font-size:12px; color:rgba(255,255,255,.70); margin-top:4px; line-height:1.35}
.toast.ok{border-color: rgba(16,185,129,.25); background: rgba(16,185,129,.10)}
.toast.bad{border-color: rgba(239,68,68,.30); background: rgba(239,68,68,.10)}
.toast.warn{border-color: rgba(245,158,11,.30); background: rgba(245,158,11,.10)}

/* Logs (Admin) */
.log-tabs{display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:10px}
.log-tabs .tab{
  padding:8px 12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  cursor:pointer;
}
.log-tabs .tab.active{border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.12)}
.log-box{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.30);
  border-radius: 16px;
  padding: 12px;
}
.log-pre{white-space:pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; line-height: 1.35; max-height: 360px; overflow:auto}
.table{width:100%; border-collapse: collapse}
.table th, .table td{border-bottom:1px solid rgba(255,255,255,.08); padding:8px; font-size: 12px; vertical-align: top}
.table th{color: rgba(255,255,255,.75); text-align:left}
