/* ── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #070B14;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.06);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.sidebar-header {
  padding: 24px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  text-decoration: none;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}
.sidebar-back-link:hover {
  color: #93C5FD;
}
.sidebar-back-link svg {
  stroke: currentColor;
}
.sidebar-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 9px;
  display: inline-block;
  margin-bottom: 10px;
}
.sidebar-badge.badge-beginner {
  color: #22C55E;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.sidebar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #E2E8F0;
  line-height: 1.4;
  letter-spacing: -0.2px;
}
.sidebar-sub {
  font-size: 11.5px;
  color: #475569;
  margin-top: 5px;
}

.sidebar-nav { padding: 10px 0 24px; flex: 1; }

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #3D5068;
  padding: 22px 22px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.04); }
.nav-item.active {
  background: rgba(59,130,246,0.08);
  border-left-color: #3B82F6;
  box-shadow: inset 0 0 24px rgba(59,130,246,0.06);
}
.nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}
.nav-item.active .nav-icon { color: #3B82F6; }
.nav-label {
  font-size: 14px;
  color: #8293A8;
  font-weight: 500;
  flex: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}
.nav-item.active .nav-label,
.nav-item:hover .nav-label { color: #E2E8F0; }
.nav-time { font-size: 11px; color: #3D5068; white-space: nowrap; font-variant-numeric: tabular-nums; }

.nav-task-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(99,130,246,0.2);
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-item.active .nav-task-num {
  background: rgba(59,130,246,0.18);
  border-color: #3B82F6;
  color: #93C5FD;
}
.nav-task-done .nav-task-num {
  background: rgba(52,211,153,0.15);
  border-color: #34D399;
  color: #34D399;
}
.nav-task-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.nav-task-info .nav-label { font-size: 13.5px; }
.nav-task-status {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(99,130,246,0.2);
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-task-done .nav-task-status {
  background: #34D399;
  border-color: #34D399;
  box-shadow: 0 0 6px rgba(52,211,153,0.4);
}

/* Locked task nav items */
.nav-task-locked {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}
.nav-task-locked .nav-task-num {
  background: rgba(100,116,139,0.1);
  border-color: rgba(100,116,139,0.2);
  color: #475569;
}
.nav-task-locked::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: auto;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

/* ── SIDEBAR FOOTER ──────────────────────────────────── */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}
.reset-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.08);
  color: #64748B;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}
.reset-btn:hover {
  background: rgba(220,38,38,0.1);
  border-color: rgba(220,38,38,0.3);
  color: #FCA5A5;
}

/* ── COLLAPSE SIDEBAR WHEN IFRAME IS OPEN ────────────── */
.sidebar {
  transition: width 0.3s ease, min-width 0.3s ease, opacity 0.2s ease;
}
.app-layout.iframe-open .sidebar {
  width: 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
