:root{
  --bg: #0b1020;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.08);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
  --line: rgba(255,255,255,0.10);
  --primary: #7c5cff;
  --ok: #2ee59d;
  --warn: #ffcc66;
  --danger: #ff5c7a;
  --shadow: 0 18px 60px rgba(0,0,0,0.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(124,92,255,0.35), transparent 60%),
              radial-gradient(900px 500px at 10% 10%, rgba(46,229,157,0.18), transparent 65%),
              var(--bg);
  color: var(--text);
}

a{color:inherit; text-decoration:none}

.app{
  display:flex;
  min-height:100vh;
}

/* Sidebar */
.sidebar{
  width: 280px;
  background: rgba(255,255,255,0.04);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(14px);
  padding: 18px 14px;
  display:flex;
  flex-direction:column;
  position: sticky;
  top:0;
  height: 100vh;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding: 10px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.brand__logo{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,92,255,0.95), rgba(46,229,157,0.75));
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.brand__name{
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.brand__sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.nav{
  display:flex;
  flex-direction:column;
  gap: 6px;
  padding-top: 10px;
}

.nav__item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  transition: 160ms ease;
}

.nav__dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15);
}

.nav__item:hover{
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.08);
}

.nav__item.is-active{
  background: rgba(124,92,255,0.18);
  border-color: rgba(124,92,255,0.28);
  color: var(--text);
}

.nav__item.is-active .nav__dot{
  background: var(--primary);
}

.sidebar__footer{
  margin-top:auto;
  padding: 12px 6px 6px;
}

.hint{
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px;
}

.hint__title{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.hint__row{display:flex; gap:10px; align-items:center}

/* Main */
.main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(14px);
  position: sticky;
  top:0;
  z-index: 20;
}

.topbar__left{display:flex; align-items:center; gap:12px}
.topbar__right{display:flex; align-items:center; gap:12px}

.page-title__h1{
  font-weight: 900;
  font-size: 18px;
}
.page-title__sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.iconbtn{
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor:pointer;
}

.search{
  width: 320px;
  max-width: 36vw;
}
.search__input{
  width:100%;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  outline:none;
}
.search__input::placeholder{color: rgba(255,255,255,0.45)}

.userchip{
  display:flex;
  gap:10px;
  align-items:center;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}

.userchip__avatar{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(124,92,255,0.22);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
}
.userchip__name{font-size: 12px; font-weight: 800}
.userchip__role{font-size: 11px; color: var(--muted); margin-top: 1px}

/* Content */
.content{
  padding: 18px 20px 26px;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.grid{
  display:grid;
  gap: 14px;
}
.grid--4{
  grid-template-columns: repeat(4, minmax(0,1fr));
}
.grid--2{
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.card{
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card__header{
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.card__title{
  font-weight: 900;
  font-size: 13px;
}
.card__sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.card__body{
  padding: 14px;
}

.kpi{padding: 14px}
.kpi__label{font-size: 12px; color: var(--muted)}
.kpi__value{font-size: 26px; font-weight: 900; margin-top: 8px}
.kpi__hint{font-size: 12px; color: rgba(255,255,255,0.52); margin-top: 6px}

.actions{display:flex; flex-wrap:wrap; gap:10px}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}
.btn--primary{
  background: rgba(124,92,255,0.22);
  border-color: rgba(124,92,255,0.35);
}

.divider{
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 14px 0;
}

.note__title{font-weight: 900; font-size: 12px}
.note__text{font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.9}

.timeline{display:flex; flex-direction:column; gap: 12px}
.tl-item{display:flex; gap:10px}
.tl-dot{
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.22);
  margin-top: 6px;
}
.tl-title{font-size: 12px; font-weight: 800}
.tl-meta{font-size: 11px; color: var(--muted); margin-top: 4px}

.mini-status{display:flex; flex-direction:column; gap: 10px}
.mini-status__row{display:flex; justify-content:space-between; align-items:center}

.table-wrap{overflow:auto; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08)}
.table{
  width:100%;
  border-collapse: collapse;
  min-width: 760px;
}
.table th, .table td{
  padding: 12px 12px;
  text-align:right;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.table th{color: rgba(255,255,255,0.72); background: rgba(255,255,255,0.03); font-weight: 900}
.table td{color: rgba(255,255,255,0.86)}

.pill{
  display:inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.12);
}
.pill--ok{background: rgba(46,229,157,0.14); border-color: rgba(46,229,157,0.26)}
.pill--gray{background: rgba(255,255,255,0.06)}

.link{color: rgba(124,92,255,0.95); font-weight: 900}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,0.12);
}
.badge--ok{background: rgba(46,229,157,0.14); border-color: rgba(46,229,157,0.26)}
.badge--warn{background: rgba(255,204,102,0.14); border-color: rgba(255,204,102,0.26)}
.badge--danger{background: rgba(255,92,122,0.14); border-color: rgba(255,92,122,0.26)}

.muted{color: var(--muted)}
.mt-12{margin-top: 12px}

.footer{
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

/* Responsive */
@media (max-width: 1100px){
  .grid--4{grid-template-columns: repeat(2, minmax(0,1fr));}
  .grid--2{grid-template-columns: 1fr;}
  .search{display:none;}
}

@media (max-width: 820px){
  .sidebar{
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(0);
    z-index: 100;
    transition: 200ms ease;
  }
  .sidebar.is-collapsed{
    transform: translateX(110%);
  }
  .topbar{
    position: sticky;
  }
}
