.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  /* width/min-width set via inline style from App.jsx */
}

.sidebar.collapsed { overflow: hidden; }

.sidebarTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}

.collapseBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 18px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.12s, background 0.12s;
  margin-left: auto;
}
.collapseBtn:hover { color: var(--text); background: var(--surface2); }

.sidebar.collapsed .sidebarTop {
  padding: 14px 0 12px;
  justify-content: center;
}
.sidebar.collapsed .collapseBtn {
  margin-left: 0;
}

.sidebarTitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
}

.sidebarCount {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green);
  background: var(--green-dim);
  padding: 2px 8px;
  border-radius: 10px;
}

.list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

/* Filters */
.filterBar {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.selectFilter {
  flex: 1;
  background: var(--surface2);
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
  font-family: var(--sans);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.selectFilter:hover {
  background: var(--surface3);
  color: var(--text);
}

.selectFilter.green { background: var(--green-dim); color: var(--green); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.selectFilter.amber { background: var(--amber-dim); color: var(--amber); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.selectFilter.red { background: var(--red-dim); color: var(--red); border-color: color-mix(in srgb, currentColor 30%, transparent); }

.selectFilter.task { background: var(--blue-dim); color: var(--blue); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.selectFilter.mcq { background: var(--purple-dim); color: var(--purple); border-color: color-mix(in srgb, currentColor 30%, transparent); }

/* Skeleton loading */
.loadingWrap { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.skeleton {
  height: 54px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* Accordion */
.group { margin-bottom: 2px; }

.accordion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-family: var(--sans);
}

.accordion:hover { background: var(--surface2); }
.accordion:hover .catResetBtn { opacity: 1; }

.accordionLeft {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chevron {
  font-size: 16px;
  color: var(--text-3);
  transition: transform 0.15s;
  display: inline-block;
  line-height: 1;
}

.chevron.open { transform: rotate(90deg); }

.catName {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text);
}

.accordionRight {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.catCount {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-3);
}

.catResetBtn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-3);
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.catResetBtn:hover {
  color: var(--red);
  background: var(--red-dim);
}

/* Show catResetBtn on accordion hover too */
.accordion:hover .catResetBtn { color: var(--text-2); }

/* Items card — subtle rounded border wrapping each category's scenarios */
.itemsBox {
  margin: 0 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--sans);
  transition: background 0.12s;
  animation: slideIn 0.15s ease both;
}
.item:last-child { border-bottom: none; }

.item:hover { background: var(--surface2); }

.item.active { background: rgba(57,217,138,0.07); }

.item.done .itemTitle { color: var(--text-2); }

.itemTop {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.itemNum {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
  opacity: 0.7;
}
.item.active .itemNum { color: var(--green); opacity: 1; }

.typeIcon {
  font-size: 12px;
  color: var(--text-3);
  flex-shrink: 0;
  margin-top: 1px;
}

.item.active .typeIcon { color: var(--green); }

.itemTitle {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
  color: var(--text);
}

.checkmark {
  color: var(--green);
  font-size: 12px;
  flex-shrink: 0;
  font-weight: 700;
}

.itemMeta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 20px;
}

/* Per-scenario inline reset button */
.itemResetBtn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-3);
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
  margin-left: auto;
}
.item:hover .itemResetBtn { opacity: 1; }
.itemResetBtn:hover {
  color: var(--red);
  background: var(--red-dim);
  opacity: 1;
}

.diff {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}

.diff.green { background: var(--green-dim); color: var(--green); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.diff.amber { background: var(--amber-dim); color: var(--amber); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.diff.red   { background: var(--red-dim);   color: var(--red);   border-color: color-mix(in srgb, currentColor 30%, transparent); }

.type {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  background: var(--surface3);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  border: 1px solid transparent;
}

.type.task { background: var(--blue-dim); color: var(--blue); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.type.mcq { background: var(--purple-dim); color: var(--purple); border-color: color-mix(in srgb, currentColor 30%, transparent); }

.weight {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  margin-left: auto;
}

@keyframes slideIn { from{opacity:0;transform:translateX(-4px)} to{opacity:1;transform:translateX(0)} }
