.datepicker {
	padding: 4px;
	direction: ltr;

	&.datepicker-rtl {
		direction: rtl;

		table tr td span {
			float: right;
		}
	}

	> div {
		display: none;
	}

	&.days div.datepicker-days,
	&.months div.datepicker-months,
	&.years div.datepicker-years {
		display: block;
	}

	table {
		margin: 0;
		border: 0;
		table-layout: auto;
		-webkit-touch-callout: none;
		-webkit-user-select: none;
		 -khtml-user-select: none;
		   -moz-user-select: none;
		    -ms-user-select: none;
		        user-select: none;

		tr td.day:hover,
		tr td.day.focused {
			background: $color-gray-lighter;
			cursor: pointer;
		}

		tr td.old,
		tr td.new {
			color: #999999;
		}

		tr td.disabled,
		tr td.disabled:hover {
			background: none;
			color: #999999;
			cursor: default;
		}

		tr td.today,
		tr td.today:hover,
		tr td.today.disabled,
		tr td.today.disabled:hover {
			background-color: #fde19a;
			border-color: #fdf59a;
			color: $color-black;
		}

		tr td.today:hover,
		tr td.today:hover:hover,
		tr td.today.disabled:hover,
		tr td.today.disabled:hover:hover,
		tr td.today:active,
		tr td.today:hover:active,
		tr td.today.disabled:active,
		tr td.today.disabled:hover:active,
		tr td.today.active,
		tr td.today:hover.active,
		tr td.today.disabled.active,
		tr td.today.disabled:hover.active,
		tr td.today.disabled,
		tr td.today:hover.disabled,
		tr td.today.disabled.disabled,
		tr td.today.disabled:hover.disabled,
		tr td.today[disabled],
		tr td.today:hover[disabled],
		tr td.today.disabled[disabled],
		tr td.today.disabled:hover[disabled] {
			background-color: #fdf59a;
		}

		tr td.today:active,
		tr td.today:hover:active,
		tr td.today.disabled:active,
		tr td.today.disabled:hover:active,
		tr td.today.active,
		tr td.today:hover.active,
		tr td.today.disabled.active,
		tr td.today.disabled:hover.active {
			background-color: #fbf069 \9;
		}

		tr td.today:hover:hover {
			color: $color-black;
		}

		tr td.today.active:hover {
			color: $color-white;
		}

		tr td.range,
		tr td.range:hover,
		tr td.range.disabled,
		tr td.range.disabled:hover {
			background: $color-gray-lighter;
			@include border-radius( 0 );
		}

		tr td.range.today,
		tr td.range.today:hover,
		tr td.range.today.disabled,
		tr td.range.today.disabled:hover {
			background-color: #f3d17a;
			border-color: #f3e97a;
			@include border-radius( 0 );
		}

		tr td.range.today:hover,
		tr td.range.today:hover:hover,
		tr td.range.today.disabled:hover,
		tr td.range.today.disabled:hover:hover,
		tr td.range.today:active,
		tr td.range.today:hover:active,
		tr td.range.today.disabled:active,
		tr td.range.today.disabled:hover:active,
		tr td.range.today.active,
		tr td.range.today:hover.active,
		tr td.range.today.disabled.active,
		tr td.range.today.disabled:hover.active,
		tr td.range.today.disabled,
		tr td.range.today:hover.disabled,
		tr td.range.today.disabled.disabled,
		tr td.range.today.disabled:hover.disabled,
		tr td.range.today[disabled],
		tr td.range.today:hover[disabled],
		tr td.range.today.disabled[disabled],
		tr td.range.today.disabled:hover[disabled] {
			background-color: #f3e97a;
		}

		tr td.range.today:active,
		tr td.range.today:hover:active,
		tr td.range.today.disabled:active,
		tr td.range.today.disabled:hover:active,
		tr td.range.today.active,
		tr td.range.today:hover.active,
		tr td.range.today.disabled.active,
		tr td.range.today.disabled:hover.active {
			background-color: #efe24b \9;
		}

		tr td.selected,
		tr td.selected:hover,
		tr td.selected.disabled,
		tr td.selected.disabled:hover {
			background-color: #9e9e9e;
			border-color: #808080;
			color: $color-white;
			text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
		}

		tr td.selected:hover,
		tr td.selected:hover:hover,
		tr td.selected.disabled:hover,
		tr td.selected.disabled:hover:hover,
		tr td.selected:active,
		tr td.selected:hover:active,
		tr td.selected.disabled:active,
		tr td.selected.disabled:hover:active,
		tr td.selected.active,
		tr td.selected:hover.active,
		tr td.selected.disabled.active,
		tr td.selected.disabled:hover.active,
		tr td.selected.disabled,
		tr td.selected:hover.disabled,
		tr td.selected.disabled.disabled,
		tr td.selected.disabled:hover.disabled,
		tr td.selected[disabled],
		tr td.selected:hover[disabled],
		tr td.selected.disabled[disabled],
		tr td.selected.disabled:hover[disabled] {
			background-color: #808080;
		}

		tr td.selected:active,
		tr td.selected:hover:active,
		tr td.selected.disabled:active,
		tr td.selected.disabled:hover:active,
		tr td.selected.active,
		tr td.selected:hover.active,
		tr td.selected.disabled.active,
		tr td.selected.disabled:hover.active {
			background-color: #666666 \9;
		}

		tr td.active,
		tr td.active:hover,
		tr td.active.disabled,
		tr td.active.disabled:hover {
			background-color: #006dcc;
			border-color: #0044cc;
			color: $color-white;
			text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
		}

		tr td.active:hover,
		tr td.active:hover:hover,
		tr td.active.disabled:hover,
		tr td.active.disabled:hover:hover,
		tr td.active:active,
		tr td.active:hover:active,
		tr td.active.disabled:active,
		tr td.active.disabled:hover:active,
		tr td.active.active,
		tr td.active:hover.active,
		tr td.active.disabled.active,
		tr td.active.disabled:hover.active,
		tr td.active.disabled,
		tr td.active:hover.disabled,
		tr td.active.disabled.disabled,
		tr td.active.disabled:hover.disabled,
		tr td.active[disabled],
		tr td.active:hover[disabled],
		tr td.active.disabled[disabled],
		tr td.active.disabled:hover[disabled] {
			background-color: #21759B;
		}

		tr td.active:active,
		tr td.active:hover:active,
		tr td.active.disabled:active,
		tr td.active.disabled:hover:active,
		tr td.active.active,
		tr td.active:hover.active,
		tr td.active.disabled.active,
		tr td.active.disabled:hover.active {
			background-color: #21759B \9;
		}

		tr td span {
			display: block;
			width: 23%;
			height: 54px;
			line-height: 54px;
			float: left;
			margin: 1%;
			cursor: pointer;
			@include border-radius( 4px );
		}

		tr td span:hover {
			background: $color-gray-lighter;
		}

		.tr td span.disabled,
		.tr td span.disabled:hover {
			background: none;
			color: #999999;
			cursor: default;
		}

		tr td span.active,
		tr td span.active:hover,
		tr td span.active.disabled,
		tr td span.active.disabled:hover {
			background-color: #006dcc;
			border-color: #0044cc;
			color: $color-white;
			text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
		}

		tr td span.active:hover,
		tr td span.active:hover:hover,
		tr td span.active.disabled:hover,
		tr td span.active.disabled:hover:hover,
		tr td span.active:active,
		tr td span.active:hover:active,
		tr td span.active.disabled:active,
		tr td span.active.disabled:hover:active,
		tr td span.active.active,
		tr td span.active:hover.active,
		tr td span.active.disabled.active,
		tr td span.active.disabled:hover.active,
		tr td span.active.disabled,
		tr td span.active:hover.disabled,
		tr td span.active.disabled.disabled,
		tr td span.active.disabled:hover.disabled,
		tr td span.active[disabled],
		tr td span.active:hover[disabled],
		tr td span.active.disabled[disabled],
		tr td span.active.disabled:hover[disabled] {
			background-color: #21759B;
		}

		tr td span.active:active,
		tr td span.active:hover:active,
		tr td span.active.disabled:active,
		tr td span.active.disabled:hover:active,
		tr td span.active.active,
		tr td span.active:hover.active,
		tr td span.active.disabled.active,
		tr td span.active.disabled:hover.active {
			background-color: #21759B \9;
		}

		tr td span.old,
		tr td span.new {
			color: #999999;
		}


	}

	td,
	th {
		text-align: center;
		width: 20px;
		height: 20px;
		border: none;
		@include border-radius( 4px );
	}

	th.datepicker-switch {
		width: 145px;
	}

	thead tr:first-child th,
	tfoot tr th {
		cursor: pointer;
	}

	thead tr:first-child th:hover,
	tfoot tr th:hover {
		background: $color-gray-lighter;
	}

	.cw {
		font-size: 10px;
		width: 12px;
		padding: 0 2px 0 5px;
		vertical-align: middle;
	}

	thead tr:first-child th.cw {
		cursor: default;
		background-color: transparent;
	}

	&.dropdown-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 1000;
		float: left;
		display: none;
		min-width: 160px;
		list-style: none;
		background-color: $color-white;
		border: 1px solid #ccc;
		border: 1px solid rgba(0, 0, 0, 0.2);
		@include border-radius( 5px );
		@include box-shadow( 0 5px 10px rgba(0, 0, 0, 0.2) );
		-webkit-background-clip: padding-box;
		-moz-background-clip: padding;
		background-clip: padding-box;
		*border-right-width: 2px;
		*border-bottom-width: 2px;
		color: $color-gray-dark;
		font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
		font-size: 13px;
		line-height: 20px;
	}

	&.dropdown-menu th,
	&.dropdown-menu td {
		padding: 4px 5px;
	}
}

.datepicker-inline {
	width: 220px;
}

.datepicker-dropdown {
	top: 0;
	left: 0;

	&:before {
		content: '';
		display: inline-block;
		border-left: 7px solid transparent;
		border-right: 7px solid transparent;
		border-bottom: 7px solid #ccc;
		border-top: 0;
		border-bottom-color: rgba(0, 0, 0, 0.2);
		position: absolute;
	}

	&:after {
		content: '';
		display: inline-block;
		border-left: 6px solid transparent;
		border-right: 6px solid transparent;
		border-bottom: 6px solid $color-white;
		border-top: 0;
		position: absolute;
	}

	&.datepicker-orient-left:before {
		left: 6px;
	}

	&.datepicker-orient-left:after {
		left: 7px;
	}

	&.datepicker-orient-right:before {
		right: 6px;
	}

	&.datepicker-orient-right:after {
		right: 7px;
	}

	&.datepicker-orient-top:before {
		top: -7px;
	}

	&.datepicker-orient-top:after {
		top: -6px;
	}

	&.datepicker-orient-bottom:before {
		bottom: -7px;
		border-bottom: 0;
		border-top: 7px solid #999;
	}

	&.datepicker-orient-bottom:after {
		bottom: -6px;
		border-bottom: 0;
		border-top: 6px solid $color-white;
	}
}

.table-striped .datepicker table tr td,
.table-striped .datepicker table tr th {
	background-color: transparent;
}

.input-append.date .add-on i,
.input-prepend.date .add-on i {
	cursor: pointer;
	width: 16px;
	height: 16px;
}

.input-daterange {
	input {
		text-align: center;
	}

	.input-daterange input:first-child {
		@include border-radius( 3px 0 0 3px );
	}

	.input-daterange input:last-child {
		@include border-radius( 0 3px 3px 0 );
	}

	.input-daterange .add-on {
		display: inline-block;
		width: auto;
		min-width: 16px;
		height: 20px;
		padding: 4px 5px;
		font-weight: normal;
		line-height: 20px;
		text-align: center;
		text-shadow: 0 1px 0 $color-white;
		vertical-align: middle;
		background-color: $color-gray-lighter;
		border: 1px solid #ccc;
		margin-left: -5px;
		margin-right: -5px;
	}
}