:root{
  --bg:#0b1020;
  --panel:#0f1730;
  --panel2:#111c38;
  --text:#e8ecff;
  --muted:#aab2d5;
  --brand:#6ea8fe;
  --accent:#22c55e;
  --border:rgba(255,255,255,.10);
  --shadow:0 12px 30px rgba(0,0,0,.35);
  --radius:16px;
  --codebg:#0a0f1f;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, Segoe UI, Tahoma, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(110,168,254,.18), transparent 60%),
              radial-gradient(1000px 500px at 90% 20%, rgba(34,197,94,.12), transparent 60%),
              var(--bg);
  color:var(--text);
  direction: rtl;
}

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

.layout{
  display:grid;
  grid-template-columns: 320px 1fr;
  min-height:100vh;
}

.sidebar{
  position:sticky; top:0; height:100vh;
  padding:18px 14px;
  background: linear-gradient(180deg, rgba(15,23,48,.92), rgba(15,23,48,.78));
  border-left:1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex; gap:10px; align-items:center; justify-content:flex-start;
  padding:10px 12px; border:1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(17,28,56,.55);
  box-shadow: var(--shadow);
}
.brand .logo{
  width:38px; height:38px; border-radius:12px;
  display:grid; place-items:center;
  background: rgba(34,197,94,.15);
  border:1px solid rgba(34,197,94,.25);
}
.brand .title{font-weight:700; line-height:1.2}
.brand .sub{font-size:12px; color:var(--muted)}

.search{
  margin-top:14px;
  display:flex; gap:10px; align-items:center;
  border:1px solid var(--border);
  background: rgba(17,28,56,.35);
  border-radius: 999px;
  padding:10px 12px;
}
.search input{
  width:100%;
  border:0; outline:none;
  background: transparent;
  color: var(--text);
  font-size:14px;
}
.search .kbd{
  font-size:12px; color:var(--muted);
  border:1px solid var(--border);
  padding:2px 8px; border-radius:10px;
}

.nav{
  margin-top:14px;
  overflow:auto;
  height: calc(100vh - 170px);
  padding:4px 6px;
}
.nav::-webkit-scrollbar{width:8px}
.nav::-webkit-scrollbar-thumb{background: rgba(255,255,255,.12); border-radius: 99px}

.nav h4{
  margin:18px 10px 8px;
  font-size:12px;
  color: var(--muted);
  letter-spacing:.4px;
}
.nav a, .nav button{
  width:100%;
  text-align:right;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid transparent;
  color: var(--text);
  background: transparent;
  cursor:pointer;
  font-family: inherit;
  font-size:14px;
}
.nav a:hover, .nav button:hover{
  background: rgba(110,168,254,.10);
  border-color: rgba(110,168,254,.20);
  text-decoration:none;
}
.nav a.active{
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.25);
}
.nav .chev{opacity:.7}
.nav .child{margin-right:10px; padding-right:8px; border-right:1px dashed rgba(255,255,255,.12)}

.main{
  padding:28px 24px 80px;
}
.topbar{
  position:sticky; top:0;
  z-index: 2;
  padding:12px 14px;
  margin:-28px -24px 22px;
  background: rgba(11,16,32,.62);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.breadcrumb{
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  color: var(--muted);
  font-size:13px;
}
.breadcrumb .dot{opacity:.6}

.content{
  max-width: 980px;
  margin:0 auto;
  background: rgba(17,28,56,.35);
  border:1px solid var(--border);
  border-radius: 22px;
  padding: 28px 26px;
  box-shadow: var(--shadow);
}

.content h1{margin-top:0; font-size:28px}
.content h2{margin-top:28px; font-size:20px}
.content h3{margin-top:22px; font-size:17px}
.content p{color: rgba(232,236,255,.92); line-height:1.9}
.content ul{line-height:1.9}
.content code{
  background: rgba(10,15,31,.85);
  border:1px solid rgba(255,255,255,.08);
  padding:2px 6px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "JetBrains Mono", monospace;
  font-size: 0.95em;
}
.content pre{
  background: var(--codebg);
  border:1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 14px;
  overflow:auto;
  direction:ltr;
}
.content pre code{border:0; background:transparent; padding:0}

.callout{
  border:1px solid rgba(110,168,254,.25);
  background: rgba(110,168,254,.08);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 14px 0;
}
.callout.success{
  border-color: rgba(34,197,94,.28);
  background: rgba(34,197,94,.10);
}
.callout.warn{
  border-color: rgba(245,158,11,.28);
  background: rgba(245,158,11,.10);
}

.results{
  margin-top:10px;
  border:1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
}
.results a{
  display:block;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  color: var(--text);
}
.results a:last-child{border-bottom:0}
.results a:hover{background: rgba(110,168,254,.10); text-decoration:none}
.results .meta{font-size:12px; color:var(--muted); margin-top:2px}

.footer{
  margin-top:20px;
  color: var(--muted);
  font-size: 12px;
  display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px;
}

@media (max-width: 980px){
  .layout{grid-template-columns: 1fr}
  .sidebar{position:relative; height:auto}
  .nav{height:auto; max-height: 45vh}
  .topbar{margin:-10px -16px 16px; padding:10px 12px}
  .main{padding:10px 16px 60px}
  .content{padding:18px 16px}
}
