.tree {
	background: @white;
}

.tree-children {
	margin-left: 3rem;

	.tree-cell {
		
	}

	.tree-cell-title {
		flex: 1 1 37rem;
	}

	.tree-children {
		
		.tree-cell-title {
			flex: 1 1 34rem;
		}

		.tree-children {
			
			.tree-cell-title {
				flex: 1 1 31rem;
			}

			.tree-children {
				
				.tree-cell-title {
					flex: 1 1 28rem;
				}
			}
		}
	}
}

.tree-node {
	
	&.drag-above,
	&.drag-below {
		position: relative;
		
		&:before {
			position: absolute;
			left: 0;
			right: 0;
			height: 2px;
			content: '';
			background: @primary;
		}
	}

	&.drag-above {
		
		&:before {
			top: 0;
			.translateY(-50%);
		}
	}

	&.drag-below {
		
		&:before {
			bottom: 0;
			.translateY(50%);
		}
	}
}

.tree-item {
	position: relative;
	
	&.drag-into {

		.tree-cell {
			border-color: @primary;
		}
	}
}

.tree-cell {
	position: relative;
	display: flex;
	align-items: center;
	padding: @padding-small;
	border: 2px solid transparent;

	&:hover {
		background: @grey-100;
	}

	&.disabled {
		background: none;
	}

	&.selected {
		color: @white;
		background: @primary;

		&:not(.dragging) {
			
			.tree-cell-icon,
			.tree-cell-title,
			.tree-cell-text {
				color: @white;
			}

			.status {
				box-shadow: 0px 0px 0px 1px fade(@dark, 20%);
			}
		}
	}

	&.dragging {
		opacity: 0.5;
		color: @grey;
		background-color: @white;
	}

	a {
		color: inherit;
		transition: none;

		&:hover,
		&:focus {
			color: inherit;
			text-decoration: underline;
		}
	}
}

.tree-cell-small {
	padding: 0.6rem;
}

.tree-cell-icon {
	flex: 0 0 2rem;
	color: @mid-grey;
}

.tree-cell-control {
	cursor: pointer;

	svg {
		margin: auto;
	}
}

.tree-cell-status {
	flex: 0 0 2.4rem;

	.status {
		display: block;
		margin: auto;
	}
}

.tree-cell-title {
	flex: 1 1 40rem;
	.semibold-font();
	.font-size(@paragraph-font-size);
	color: @grey;
	line-height: 18px;
	.truncate();

	&.disabled {
		color: @grey-400;
	}
}

.tree-cell-text {
	flex: 1 1 20rem;
	.regular-font();
	.font-size(@font-size-small);
	color: @grey-500;
	line-height: 18px;
	.truncate();
}

.tree-cell-count {
	position: absolute;
	top: 0;
	right: 0;
	padding: 4px 2px;
	.square(20px);
	.bold-font();
	font-size: 12px;
	color: @white;
	line-height: 1;
	text-align: center;
	background: red;
	border-radius: 10px;
	.translate(50%, -50%);
}

.tree-overlay {
	position: fixed;
	pointer-events: none;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	cursor: grabbing;

	.tree-cell {
		width: 35rem;
		margin-left: -@margin-xlarge;
		background: @primary;

		.tree-cell-icon,
		.tree-cell-title,
		.tree-cell-text {
			color: @white;
		}
	}
}