:root{
  --bg:#050816;
  --card:rgba(255,255,255,0.06);
  --border:rgba(255,255,255,0.10);
  --text:#eaf0ff;
  --muted:rgba(234,240,255,0.65);
  --grad:linear-gradient(90deg,#6366f1,#22c55e);
  --shadow:0 18px 60px rgba(0,0,0,0.45);
}

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

.bg{
  position:fixed; inset:-25%;
  background:
    radial-gradient(circle at 20% 20%, rgba(99,102,241,0.35), transparent 45%),
    radial-gradient(circle at 70% 40%, rgba(34,197,94,0.25), transparent 50%),
    radial-gradient(circle at 50% 85%, rgba(167,139,250,0.20), transparent 50%);
  filter: blur(35px);
  z-index:-1;
}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 16px;
  background:rgba(5,8,22,0.55);
  backdrop-filter: blur(16px);
  border-bottom:1px solid var(--border);
}

.brand{display:flex; gap:12px; align-items:center}
.dot{
  width:14px;height:14px;border-radius:999px;
  background:linear-gradient(135deg,#60a5fa, #a78bfa, #34d399);
  box-shadow:0 0 25px rgba(99,102,241,0.6);
}
.name{font-weight:900; letter-spacing:0.2px}
.tag{font-size:12px;color:var(--muted)}

.tabs{display:flex; gap:8px; flex-wrap:wrap}
.tab{
  border:none; cursor:pointer;
  padding:10px 14px; border-radius:999px;
  background:rgba(255,255,255,0.08);
  color:var(--text);
}
.tab.active{background:var(--grad); box-shadow:0 10px 25px rgba(0,0,0,0.35)}

.wrap{max-width:1100px; margin:18px auto; padding:0 14px 40px}

.grid{display:grid; grid-template-columns: 1.4fr 0.8fr; gap:14px}
@media(max-width:900px){ .grid{grid-template-columns:1fr} }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow);
}
.big{border-radius:22px}

h2,h3{margin:0 0 10px}
.muted{color:var(--muted)}
.hint{font-size:12px;color:var(--muted);margin-top:6px}
.list{margin:0; padding-left:18px}
.list li{margin:8px 0}

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

.form{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:12px;
}
@media(max-width:700px){ .form{grid-template-columns:1fr} }

.field label{
  font-size:12px;
  color:var(--muted);
  display:block;
  margin-bottom:6px;
}

input, select, textarea{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(2,6,23,0.55);
  color:var(--text);
  outline:none;
}
textarea{resize:vertical}
.full{grid-column:1/-1}

.actions{display:flex; gap:10px; margin-top:14px}
.btn{
  border:none;
  padding:12px 14px;
  border-radius:12px;
  cursor:pointer;
  color:var(--text);
  background:rgba(255,255,255,0.08);
}
.btn.primary{background:var(--grad); box-shadow:0 10px 30px rgba(0,0,0,0.35)}
.btn.ghost{background:rgba(255,255,255,0.08)}

.box{
  margin-top:14px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(2,6,23,0.45);
}

.row{display:flex; gap:10px; align-items:center; margin-top:10px}
.row input{flex:1}

.chips{display:flex; gap:8px; flex-wrap:wrap}
.chip{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.06);
  cursor:pointer;
}
.chip.active{background:rgba(99,102,241,0.22); border-color:rgba(99,102,241,0.45)}

.pill{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,0.09);
  border:1px solid rgba(255,255,255,0.10);
  margin-right:8px;
  font-size:12px;
}

.timeline{margin-top:10px; display:grid; gap:8px}
.tlItem{
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.04);
  font-size:13px;
}

.chat{margin-top:14px; border-radius:18px; border:1px solid rgba(255,255,255,0.12); background:rgba(2,6,23,0.45); overflow:hidden}
.chatTop{display:flex; justify-content:space-between; align-items:center; padding:12px; border-bottom:1px solid rgba(255,255,255,0.10); background:rgba(255,255,255,0.03)}
.chatTitle{font-weight:900}
.msgs{height:330px; overflow:auto; padding:12px; display:flex; flex-direction:column; gap:10px}
.bubble{
  max-width:80%;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.06);
}
.bubble.user{align-self:flex-end; background:rgba(99,102,241,0.18)}
.bubble.admin{align-self:flex-start; background:rgba(34,197,94,0.14)}
.bubble .meta{font-size:11px; color:var(--muted); margin-top:6px}

.admin .filters{
  display:grid;
  grid-template-columns: 1fr 160px 160px 180px auto;
  gap:10px;
  margin-top:10px;
}
@media(max-width:900px){ .admin .filters{grid-template-columns:1fr 1fr} }

.split{display:grid; grid-template-columns: 1fr 1fr; gap:14px; margin-top:12px}
@media(max-width:900px){ .split{grid-template-columns:1fr} }

.subhead{font-weight:800; margin-top:8px}

.ticketList{display:grid; gap:10px; max-height:420px; overflow:auto; padding-right:4px}
.ticketRow{
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.04);
  cursor:pointer;
}
.ticketRow:hover{background:rgba(255,255,255,0.06)}
.ticketRow .top{display:flex; justify-content:space-between; gap:10px; font-weight:800}
.ticketRow .sub{margin-top:6px; font-size:12px; color:var(--muted)}

.detail{line-height:1.6}

.catEditor{display:grid; gap:10px; margin-top:10px}
.catBlock{
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.10);
  background:rgba(255,255,255,0.04);
}

.toast{
  position:fixed;
  left:50%;
  bottom:24px;
  transform:translateX(-50%);
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(2,6,23,0.70);
  backdrop-filter: blur(12px);
  box-shadow:var(--shadow);
  display:none;
  max-width:92vw;
  }
