
.checklist-progress {
  margin: 0 0 10px 0;
  padding: 0 8px;
}
.checklist-progress-bar {
  height: 6px;
  border-radius: 3px;
  width: 0%;
  background: linear-gradient(90deg, #e74c3c 0%, #f39c12 25%, #f1c40f 50%, #2ecc71 100%);
  background-size: 400% 100%;
  background-position: 0% 50%;
  transition: width 0.4s ease, background-position 0.4s ease;
}
.checklist-progress-label {
  display: inline-block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

#checklist-items {
  display: flex;
  flex-direction: column;
}

.checklist-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  opacity: 0.5;
  padding: 8px 0 4px 28px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 8px;
  border-radius: 6px;
  cursor: default;
  transition: transform 0.18s ease, margin 0.18s ease, opacity 0.15s ease;
  position: relative;
  user-select: none;
}
.checklist-item:hover {
  background: var(--bg-secondary);
}

.checklist-item.level-0 { padding-left: 8px; }
.checklist-item.level-0 .checklist-item-text { font-weight: 600; font-size: 13px; }
.checklist-item.level-1 { padding-left: 36px; }
.checklist-item.level-2 { padding-left: 64px; }

.checklist-item.completed .checklist-item-text {
  text-decoration: line-through;
  color: var(--text-secondary);
  opacity: 0.6;
}

.checklist-item.dragging {
  opacity: 0.4;
}
.checklist-item.drag-over {
  box-shadow: inset 0 2px 0 var(--accent);
  margin-top: 34px;
}
.checklist-item.drag-indent {
  box-shadow: inset 0 2px 0 var(--accent);
  padding-left: 56px !important;
}
.checklist-item.drag-outdent {
  box-shadow: inset 0 2px 0 var(--accent);
  padding-left: 8px !important;
}
.checklist-item {
  transition: opacity 0.12s ease, box-shadow 0.12s ease;
  will-change: transform;
}

/* 6-dot drag handle */
.checklist-drag-handle {
  flex-shrink: 0;
  width: 20px;
  height: 22px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  transition: opacity 0.15s;
  padding: 0;
  background: none;
  border: none;
}
.checklist-item:hover .checklist-drag-handle {
  opacity: 0.6;
}
.checklist-drag-handle:active {
  cursor: grabbing;
}
.checklist-drag-dots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px 4px;
  width: 14px;
  height: 16px;
}
.checklist-drag-dots i {
  display: block;
  width: 3px;
  height: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
}

/* Checkbox */
.checklist-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  background: none;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.6;
}
.checklist-checkbox:hover {
  border-color: var(--accent);
  opacity: 1;
}
.checklist-checkbox.checked {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  opacity: 1;
}

/* Auto-numbering */
.checklist-number {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 20px;
  text-align: right;
  opacity: 0.6;
  user-select: none;
}

/* Text */
.checklist-item-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  min-height: 20px;
  color: var(--text-primary);
  padding: 1px 0;
}
.checklist-item-text.empty::before {
  content: 'Элемент списка';
  color: var(--text-secondary);
  opacity: 0.35;
}
.checklist-item-text.empty:focus::before {
  content: 'Элемент списка';
  color: var(--text-secondary);
  opacity: 0.35;
}

/* Delete button */
.checklist-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 50%;
  opacity: 0;
  transition: all 0.15s;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.checklist-item:hover .checklist-delete-btn,
.checklist-item-text:focus ~ .checklist-delete-btn {
  opacity: 0.6;
}
.checklist-delete-btn:hover {
  opacity: 1;
  color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

/* Sub-item add button — always visible */
.checklist-sub-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 20px;
  font-weight: 300;
  padding: 0 4px;
  border-radius: 50%;
  opacity: 0.3;
  transition: all 0.15s;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.checklist-item:hover .checklist-sub-btn {
  opacity: 0.5;
}
.checklist-sub-btn:hover {
  opacity: 1;
  color: var(--success);
  background: rgba(76, 175, 80, 0.1);
}

/* Add button at bottom */
#checklist-add-item {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  text-align: left;
  font-family: inherit;
}
#checklist-add-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(233, 69, 96, 0.03);
}

/* === Calendar === */
