:root{
  --ns-primary: #4f46e5;
  --ns-primary-light: #6366f1;
  --ns-secondary: #a855f7;
  --ns-accent: #4f46e5;
  --ns-gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --ns-gradient-accent: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
  --ns-bg: #f8fafc;
  --ns-card: #ffffff;
  --ns-text: #1e293b;
  --ns-muted: #64748b;
  --ns-border: rgba(15, 23, 42, 0.08);
  --ns-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body[data-ns-theme="dark"]{
  --ns-bg: #0f172a;
  --ns-card: #1e293b;
  --ns-text: #f1f5f9;
  --ns-muted: #94a3b8;
  --ns-border: rgba(255, 255, 255, 0.1);
  --ns-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

html, body{height:100%;}
body{
  margin:0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--ns-bg);
  color: var(--ns-text);
  line-height: 1.5;
}

/* layout */
#root.ns-layout{
  min-height:100vh;
  display:flex;
}

.ns-sidebar{
  width: 260px;
  background: var(--ns-card);
  border-right: 1px solid var(--ns-border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  box-shadow: 4px 0 20px rgba(0,0,0,0.02);
}

.ns-main{
  flex:1;
  min-width:0;
}

/* sidebar header */
.ns-brand{
  padding: 24px 20px 16px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
}
.ns-brand img{max-width:140px; height:auto;}

.ns-sidebar-actions{padding: 0 20px 20px; display:grid; gap:12px;}
.ns-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 16px;
  border-radius: 12px;
  text-decoration:none;
  font-weight: 600;
  border: 1px solid transparent;
  user-select:none;
  transition: all 0.2s ease;
}
.ns-btn.primary{
  background: var(--ns-gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}
.ns-btn.primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}
.ns-btn.secondary{
  background: var(--ns-gradient-accent);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}
.ns-btn.secondary:hover{
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
}

/* menu */
.ns-menu{padding: 0 12px 24px;}
.ns-section{
  margin-bottom: 20px;
}
.ns-section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 16px;
  font-size: 11px;
  color: var(--ns-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ns-section-title .left{display:flex; align-items:center; gap:10px;}
.ns-section-title .chev{transition: transform .15s ease; font-size: 10px;}
.ns-section[data-open="true"] .chev{transform: rotate(180deg);}

.ns-section-items{
  padding: 0;
  display:none;
}
.ns-section[data-open="true"] .ns-section-items{display:block;}

.ns-link{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 16px;
  margin: 4px 8px;
  border-radius: 12px;
  text-decoration:none;
  color: var(--ns-text);
  font-weight: 500;
  transition: all 0.2s ease;
}
.ns-link i{width:20px; text-align:center; color: var(--ns-muted); transition: inherit;}
.ns-link:hover{
  background: rgba(79, 70, 229, 0.05);
  color: var(--ns-primary);
}
.ns-link:hover i{color: var(--ns-primary);}

.ns-link.active{
  background: var(--ns-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
.ns-link.active i{color: #ffffff;}

.ns-pill{
  margin-left:auto;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--ns-primary);
  font-weight: 700;
}

/* topbar */
.ns-topbar{
  height: 70px;
  padding: 0 24px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  background: var(--ns-card);
  border-bottom: 1px solid var(--ns-border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.ns-iconbtn{
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border: 1px solid var(--ns-border);
  background: var(--ns-bg);
  color: var(--ns-muted);
  transition: all 0.2s ease;
}
.ns-iconbtn:hover{
  border-color: var(--ns-primary);
  color: var(--ns-primary);
  background: rgba(79, 70, 229, 0.05);
}

.ns-loginbtn{
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--ns-gradient-primary);
  color: #ffffff;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
  transition: all 0.2s ease;
}
.ns-loginbtn:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3);
}

/* theme popover */
.ns-popover{
  position: absolute;
  top: 65px;
  right: 24px;
  width: 280px;
  background: var(--ns-card);
  border: 1px solid var(--ns-border);
  border-radius: 18px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.1);
  padding: 16px;
  display:none;
}
.ns-popover[data-open="true"]{display:block;}

.ns-toggle{
  display:flex;
  gap:8px;
  margin-bottom: 16px;
  background: var(--ns-bg);
  padding: 4px;
  border-radius: 12px;
}
.ns-toggle button{
  flex:1;
  padding: 8px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ns-muted);
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s ease;
}
.ns-toggle button.active{
  background: var(--ns-card);
  color: var(--ns-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ns-swatches{display:grid; grid-template-columns: repeat(6, 1fr); gap: 10px;}
.ns-swatch{
  width: 28px; height: 28px;
  border-radius: 9px;
  border: 2px solid rgba(0,0,0,0.05);
  outline: none;
  cursor:pointer;
  transition: transform 0.2s ease;
}
.ns-swatch:hover{transform: scale(1.15);}
body[data-ns-theme="dark"] .ns-swatch{border-color: rgba(255,255,255,0.1);}
.ns-swatch.active{
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
  border-color: #fff;
}

/* content */
.ns-content{padding: 24px;}

.ns-card{
  background: var(--ns-card);
  border: 1px solid var(--ns-border);
  border-radius: 20px;
  box-shadow: var(--ns-shadow);
  padding: 24px;
}

.ns-banner-welcome {
  background: var(--ns-gradient-primary);
  border-radius: 24px;
  padding: 40px;
  color: #ffffff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.25);
}
.ns-banner-welcome::after {
  content: "";
  position: absolute;
  top: -20%; right: -10%;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  filter: blur(60px);
}
.ns-banner-welcome .badge {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 12px;
  display: inline-block;
}
.ns-banner-welcome h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.ns-banner-welcome p {
  opacity: 0.85;
  font-size: 15px;
  max-width: 500px;
}

.ns-post-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.ns-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.08);
  border-color: var(--ns-primary-light);
}

/* slider */
.ns-slider{position:relative; overflow:hidden; border-radius: 20px;}
.ns-slider img{width:100%; height:auto; display:block;}
.ns-slider .nav{
  position:absolute; top: 50%; transform: translateY(-50%);
  width:40px; height:40px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(0,0,0,.25);
  color: #fff;
  display:flex; align-items:center; justify-content:center;
}
.ns-slider .nav.left{left: 12px;}
.ns-slider .nav.right{right: 12px;}

/* responsive */
@media (max-width: 980px){
  .ns-sidebar{position: fixed; left:0; top:0; transform: translateX(-110%); transition: transform .2s ease; z-index: 50;}
  .ns-sidebar[data-open="true"]{transform: translateX(0);}
  .ns-topbar{justify-content: space-between;}
  .ns-burger{display:inline-flex;}
}
@media (min-width: 981px){
  .ns-burger{display:none;}
}

.ns-overlay{
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  z-index: 40; display:none;
}
.ns-overlay[data-open="true"]{display:block;}

.ns-selection-item {
  border: 2px solid var(--ns-border);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--ns-card);
  text-align: center;
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ns-selection-item:hover {
  border-color: var(--ns-primary-light);
  background: rgba(79, 70, 229, 0.02);
  transform: translateY(-2px);
}
.ns-selection-item.selected {
  border-color: var(--ns-primary);
  background: rgba(79, 70, 229, 0.05);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.12);
}
.ns-selection-item.selected::after {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 8px; right: 8px;
  color: var(--ns-primary);
  font-size: 16px;
}

.ns-selection-item .title {
  font-weight: 800;
  font-size: 18px;
  color: var(--ns-primary);
  margin-bottom: 4px;
}
.ns-selection-item .sub {
  font-size: 12px;
  color: var(--ns-muted);
  font-weight: 600;
}
.ns-selection-item .desc {
  font-weight: 700;
  color: #f43f5e;
  margin-top: 4px;
}

/* Progress Bar & Milestones */
.ns-progress-container {
  padding: 20px 10px 40px;
}
.ns-progress-track {
  height: 10px;
  background: var(--ns-border);
  border-radius: 999px;
  position: relative;
  margin-bottom: 30px;
}
.ns-progress-fill {
  height: 100%;
  background: var(--ns-gradient-primary);
  border-radius: 999px;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.4);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.ns-milestone-list {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex; justify-content: space-between;
  pointer-events: none;
}
.ns-milestone-item {
  position: relative;
  height: 100%;
}
.ns-milestone-dot {
  width: 14px; height: 14px;
  background: #fff;
  border: 3px solid var(--ns-border);
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.ns-milestone-item.active .ns-milestone-dot {
  border-color: var(--ns-primary);
  background: var(--ns-primary);
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}
.ns-milestone-label {
  position: absolute;
  top: 25px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--ns-muted);
  white-space: nowrap;
  text-align: center;
}
.ns-milestone-label img {
  width: 20px; height: 20px;
  display: block; margin: 0 auto 4px;
}
.ns-milestone-item.active .ns-milestone-label {
  color: var(--ns-primary);
}
