:root{
  --bg:#0b0f17;
  --bg2:#070a10;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.12);
  --text:#e9eef7;
  --muted: rgba(233,238,247,.72);
  --accent:#6ea8ff;
  --accent2:#3f73e6;
  --good:#39d98a;
  --bad:#ff5b5b;
  --shadow: 0 18px 60px rgba(0,0,0,.48);
  --radius: 18px;
}

*{ 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(900px 500px at 20% -10%, rgba(110,168,255,.20), transparent 60%),
    radial-gradient(900px 500px at 95% 10%, rgba(57,217,138,.10), transparent 55%),
    radial-gradient(700px 420px at 70% 120%, rgba(110,168,255,.12), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

/* Layout */
.shell{
  min-height:100vh;
  display:grid;
  grid-template-columns: 290px 1fr;
}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  border-right:1px solid var(--border);
  background: rgba(6,9,15,.70);
  backdrop-filter: blur(12px);
  padding:18px 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 10px 16px;
  border-bottom:1px solid var(--border);
  margin-bottom:14px;
}
.logo{
  width:40px; height:40px;
  border-radius:14px;
  background: linear-gradient(145deg, rgba(110,168,255,.95), rgba(57,217,138,.65));
  box-shadow: var(--shadow);
}
.brand .name{ font-weight:950; letter-spacing:.2px; }
.brand .tag{ color:var(--muted); font-size:12px; margin-top:2px; }

.nav .hint{
  margin:14px 10px 8px;
  font-size:11px;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--muted);
}
.nav a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  margin:6px 6px;
  border-radius:14px;
  color:var(--text);
  background: transparent;
  border:1px solid transparent;
}
.nav a:hover{
  background: var(--panel2);
  border-color: var(--border);
  text-decoration:none;
}
.nav a.active{
  background: rgba(110,168,255,.10);
  border-color: rgba(110,168,255,.22);
}
.badge{
  font-size:12px;
  color:var(--muted);
  padding:4px 8px;
  border:1px solid var(--border);
  border-radius:999px;
  background: rgba(255,255,255,.03);
}

.main{
  padding:22px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.topbar h1{
  margin:0;
  font-size:16px;
  letter-spacing:.2px;
}
.topbar .sub{
  margin-top:4px;
  color:var(--muted);
  font-size:13px;
}

.search{
  flex:1;
  max-width:520px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
}
.search input{
  width:100%;
  border:0;
  outline:0;
  background: transparent;
  color: var(--text);
  font-size:14px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
  user-select:none;
}
.btn:hover{ background: rgba(255,255,255,.10); text-decoration:none; }
.btn.primary{
  border-color: rgba(110,168,255,.35);
  background: rgba(110,168,255,.14);
}
.btn.primary:hover{
  background: rgba(110,168,255,.20);
}
.btn.ghost{
  background: transparent;
}
.btn.small{ padding:8px 10px; border-radius:12px; font-size:13px; }
.btn.full{ width:100%; }

/* Cards */
.grid{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}
.card{
  grid-column: span 4;
  border-radius: var(--radius);
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card .hd{
  padding:14px 14px 10px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.card .title{ font-weight:900; }
.card .sub{ color: var(--muted); font-size:13px; margin-top:4px; }
.card .bd{ padding: 0 14px 14px; color: var(--muted); font-size:14px; line-height:1.45; }

/* Character card */
.char-card{
  grid-column: span 4;
  border-radius: var(--radius);
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height: 170px;
}
.char-top{
  display:flex;
  gap:12px;
  padding:14px;
}
.avatar{
  width:52px; height:52px;
  border-radius:16px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  display:grid;
  place-items:center;
  font-weight:900;
  color: rgba(255,255,255,.8);
}
.char-meta .name{ font-weight:950; }
.char-meta .mini{ color:var(--muted); font-size:13px; margin-top:4px; }
.char-actions{
  margin-top:auto;
  padding:12px 14px 14px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
  border-top:1px solid var(--border);
  background: rgba(0,0,0,.12);
}

/* Forms */
.form{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:14px;
}
.field label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:0 0 6px 2px;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.input, .select, .textarea{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.25);
  color: var(--text);
  outline:none;
  font-size:14px;
}
.textarea{ min-height: 180px; resize: vertical; line-height:1.5; }
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(110,168,255,.45);
  box-shadow: 0 0 0 4px rgba(110,168,255,.12);
}
.two{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.three{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap:12px;
}
hr.sep{
  border:0;
  border-top:1px solid var(--border);
  margin:14px 0;
}

.alert{
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  border-radius:14px;
  padding:10px 12px;
  color: var(--muted);
}
.alert.bad{
  border-color: rgba(255,91,91,.35);
  background: rgba(255,91,91,.10);
  color: rgba(255,255,255,.86);
}
.alert.good{
  border-color: rgba(57,217,138,.35);
  background: rgba(57,217,138,.10);
  color: rgba(255,255,255,.86);
}

/* Tabs */
.tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.tab{
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--muted);
}
.tab.active{
  color: var(--text);
  background: rgba(110,168,255,.12);
  border-color: rgba(110,168,255,.25);
  text-decoration:none;
}

/* Auth pages */
.auth{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:26px;
}
.auth-wrap{
  width:100%;
  max-width:980px;
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap:18px;
}
.hero{
  position:relative;
  border:1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,.04);
  box-shadow: var(--shadow);
  overflow:hidden;
  padding:22px;
}
.hero::before{
  content:"";
  position:absolute;
  inset:-120px -140px auto auto;
  width:340px; height:340px;
  background: radial-gradient(circle at 30% 30%, rgba(110,168,255,.35), transparent 60%);
  transform: rotate(12deg);
  opacity:.9;
}
.hero::after{
  content:"";
  position:absolute;
  inset:auto auto -120px -120px;
  width:320px; height:320px;
  background: radial-gradient(circle at 40% 40%, rgba(57,217,138,.22), transparent 60%);
  opacity:.9;
}
.hero .inner{ position:relative; z-index:1; }
.hero h2{ margin:0 0 10px; font-size:26px; letter-spacing:.2px; }
.hero p{ margin:0; color:var(--muted); line-height:1.55; }
.hero .pill{
  margin-top:14px;
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  color:var(--muted);
  font-size:13px;
}

.panel{
  border:1px solid var(--border);
  border-radius: 22px;
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  padding:22px;
}
.panel h3{ margin:0 0 10px; font-size:18px; }
.panel .help{ color:var(--muted); font-size:13px; margin-bottom:14px; }

.footer-links{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:13px;
}

/* Responsive */
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .sidebar{ display:none; }
  .card, .char-card{ grid-column: span 12; }
  .two, .three{ grid-template-columns: 1fr; }
  .auth-wrap{ grid-template-columns:1fr; }
}
