$font: -apple-system, BlinkMacSystemFont, "segoe ui", roboto, oxygen, ubuntu, cantarell, "fira sans", "droid sans", "helvetica neue", Arial, sans-serif;
$font-size: 16px;
$header-size: 55px;
$aside-width: 260px;
$text-color: #555555;
$header-color: #4a5361;
$admin-color: #383c46;
$background-color: mix($admin-color, #fff, 10);
$btn-color: #4a79b4;
$btn-alt-color: #b44a4a;
* {
	box-sizing: border-box;
	font-family: $font;
    font-size: $font-size;
    -webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
html {
  	height: 100%;
}
body {
	position: relative;
	min-height: 100%;
	color: $text-color;
    background-color: $background-color;
	margin: 0;
}
h1, h2, h3, h4, h5 {
	color: $header-color;
	margin: 0;
	padding: 0;
}
header {
	display: flex;
	position: fixed;
	top: 0;
	left: 0;
	padding-left: $aside-width;
	z-index: 999;
	width: 100%;
	height: $header-size;
	background-color: #fff;
	box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.15);
	a {
		display: inline-flex;
		color: $header-color;
		height: 100%;
		text-decoration: none;
		justify-content: center;
		align-items: center;
		padding: 0 20px;
		i {
			font-size: 16px;
		}
		&:hover, &:active {
			color: lighten($header-color, 10);
		}
	}
	.space-between {
		flex: 1;
	}
	&.full {
		padding-left: 0;
	}
}
aside {
	position: fixed;
	z-index: 999999;
	height: 100%;
	width: $aside-width;
	display: flex;
	flex-flow: column;
	background-color: darken($admin-color, 8);
	h1 {
		display: inline-flex;
		background-color: #5472bd;
		width: 100%;
		height: $header-size;
		color: #fff;
		padding: 0;
		margin: 0;
		font-weight: 600;
		font-size: 14px;
		align-items: center;
		padding: 0 20px;
		justify-content: center;
	}
	> a {
		font-size: 14px;
		font-weight: 600;
		text-decoration: none;
		color: mix($admin-color, #fff, 40);
		padding: 15px 20px;
		i {
			width: 40px;
		}
		&:hover, &.selected {
			background-color: mix($admin-color, #4a79b4, 98);
			color: #fff;
			border-left: 3px solid #4a79b4;
			padding: 15px 17px;
		}
		&.selected + .sub {
			display: flex;
		}
		.note {
			background-color: darken($admin-color, 0);
			padding: 1px 5px;
			border-radius: 4px;
			font-size: 12px;
			margin-left: 10px;
		}
	}
	.sub {
		display: none;
		flex-flow: column;
		background-color: darken($admin-color, 12);
		padding: 13px 0;
		a {
			font-size: 14px;
			color: mix($admin-color, #fff, 40);
			text-decoration: none;
			padding: 4px 20px;
			span {
				display: inline-block;
				width: 40px;
				font-size: 12px;
			}
			&:hover, &.selected {
				color: #fff;
			}
		}
	}
	&.closed {
		display: none;
	}
}
main {
	$padding: 30px;
	padding: $padding;
	padding-left: $aside-width + $padding;
	padding-top: $header-size + $padding;
	&.full {
		padding-left: $padding;
		padding-right: $padding;
	}
	h2 {
		font-size: 20px;
		padding-bottom: 20px;
		border-bottom: 1px solid darken($background-color, 6);
		span {
			font-size: 16px;
			margin-left: 5px;
			font-weight: 600;
			color: lighten($header-color, 30);
		}
	}
	.msg {
		display: flex;
		align-items: center;
		margin: 15px 0 0 0;
		padding: 15px;
		font-weight: 500;
		box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.1);
		p {
			margin: 0;
			padding: 0 15px;
			font-size: 14px;
			flex: 1;
		}
		i.fa-times {
			align-self: flex-end;
			justify-content: flex-end;
			cursor: pointer;
			&:hover {
				opacity: .9;
			}
		}
		&.success {
			background-color: #C3F3D7;
			border-left: 4px solid #51a775;
			color: #51a775;
			i {
				color: #51a775;
			}
		}
		&.error {
			background-color: #f3c3c3;
			border-left: 4px solid #a75151;
			color: #a75151;
			i {
				color: #a75151;
			}
		}
	}
	.content-header {
		display: flex;
		justify-content: space-between;
		form {
			display: flex;
			justify-content: space-between;
		}
		.search {
			label {
				position: relative;
			}
			input {
				background-color: transparent;
				outline: none;
				border: none;
				padding: 10px 0;
				width: 250px;
				border-bottom: 1px solid darken($background-color, 10);
				padding-right: 25px;
				&:hover, &:active {
					border-bottom: 1px solid darken($background-color, 20);
				}
			}
			i {
				position: absolute;			
				right: 4px;
				top: 4px;
				bottom: 0;
				font-size: 14px;
				margin-top: auto;
				margin-bottom: auto;
				color: darken($background-color, 20);
			}
		}
	}
	.content-block {
		background-color: #fff;
		margin-top: 25px;
		padding: 15px;
		box-shadow: 0px 0px 5px 1px rgba(0,0,0,0.03);
	}
	.tabs {
		display: flex;
		background-color: darken($background-color, 5);
		margin-top: 25px;
		box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.03);
		z-index: 100;
		a {
			display: flex;
			text-decoration: none;
			padding: 12px 15px;
			border: 0;
			color: lighten($header-color, 15);
			font-weight: 600;
			font-size: 14px;
			&:hover {
				background-color: darken($background-color, 7);;
			}
			&.active {
				color: $header-color;
				background-color: #fff;
			}
		}
	}
	.tabs ~ .content-block {
		margin-top: 0;
		box-shadow: 0px 6px 5px 1px rgba(0,0,0,0.03);
	}
	.tab-content {
		display: none;
		&.active {
			display: block;
		}
	}
	.dashboard {
		display: flex;
		justify-content: space-between;
		padding-bottom: 40px;
		.stat {
			width: 24%;
			display: flex;
			justify-content: space-between;
			i {		
				display: inline-flex;
				justify-content: center;
				padding: 15px;
				margin: 20px 15px 0 0;
				align-items: center;
				font-size: 18px;
				height: 50px;
				width: 50px;
				border-radius: 50%;
				background-color: #d5e7fa;
				color: #6e94ba;
			}
			h3 {
				font-size: 16px;
				font-weight: 400;
				padding: 15px 15px 0 15px;
			}
			p {
				margin: 0;
				padding: 15px;
				font-size: 26px;
				font-weight: 700;
			}
		}
	}
	.filters {
		display: flex;
		position: relative;
		margin-right: 25px;
		margin-bottom: 3px;
		align-items: center;
		a {
			text-decoration: none;
			font-weight: 600;
			color: $header-color;
			white-space: nowrap;
			&:hover {
				color: darken($header-color, 10);
			}
		}
		.list {
			display: none;
			top: calc(100% + 5px);
			width: 180px;
			flex-flow: column;
			position: absolute;
			background-color: #fff;
			padding: 10px;
			box-shadow: 0px 0px 5px 1px rgba(0,0,0,0.1);
			label {
				padding-bottom: 5px;
				font-size: 14px;
			}
			input {
				margin-right: 10px;
			}
			button {
				background: $btn-color;
				border: 0;
				color: #FFFFFF;
				padding: 5px 0;
				font-size: 12px;
				font-weight: 600;
				margin-top: 5px;
				cursor: pointer;
				border-radius: 4px;
				&:hover {
					background: darken($btn-color, 3);
				}				
			}
		}
	}
	.table {
		padding: 0 10px;
		table {
			width: 100%;
			border-collapse: collapse;
			thead {
				td {
					font-weight: 600;
					font-size: 14px;
					padding: 15px 0;
					a {
						font-weight: inherit;
						font-size: inherit;
						color: inherit;
						text-decoration: none;
					}
					i {
						padding-left: 5px;
					}
				}
				tr {
					border-bottom: 1px solid lighten($background-color, 2);
				}
			}
			tbody {
				tr:first-child td {
					padding-top: 10px;
				}
				td {
					padding: 5px 0;
				}
				.img {
					width: 50px;
				}
			}
		}
	}
	tbody td a, .link1 {
		text-decoration: none;
		color: #0060ba;
		border-bottom: 1px dotted;
		margin: 0 5px 0 0;
		&:hover {
			color: #003260;
		}
	}
	.form {
		display: flex;
		flex-flow: column;
		width: 500px;
		padding: 20px;
		input, textarea, select {
			width: 100%;
			padding: 15px 5px;
			margin-bottom: 25px;
			border: 0;
			border-bottom: 1px solid darken($background-color, 5);
			&:hover, &:active {
				border-bottom: 1px solid darken($background-color, 20);
			}
		}
		textarea {
			height: 200px;
		}
		input[type="checkbox"] {
			width: auto;
			margin: 15px 0 25px 2px;
			transform: scale(1.2);
		}
		input[type="submit"] {
			background: $btn-color;
			border: 0;
			color: #FFFFFF;
			width: auto;
			padding: 12px 15px;
			font-size: 14px;
			font-weight: 600;
			cursor: pointer;
			border-radius: 4px;
			&:hover {
				background: darken($btn-color, 3);
			}
		}
		label {
			display: block;
			font-weight: 600;
		}
		button {
			background-color: darken($background-color, 5);
			color: darken($background-color, 50);
			border: 0;
			padding: 5px;
			width: 100%;
			font-weight: 600;
			font-size: 14px;
			cursor: pointer;
			&:hover {
				background-color: darken($background-color, 8);
			}
		}
		.submit-btns {
			display: flex;
			input:first-child {
				margin-right: 10px;
			}
			.delete {
				background-color: #b03b3b;
				&:hover {
					background-color: darken(#b03b3b, 3);
				}
			}
		}
	}
	.links {
		display: flex;
		flex-flow: wrap;
		padding-top: 20px;
		> a {
			display: inline-flex;
			text-decoration: none;
			background: $btn-color;
			color: #FFFFFF;
			padding: 12px 15px;
			margin-right: 10px;
			font-size: 14px;
			font-weight: 600;
			border-radius: 4px;
			&:hover {
				background: darken($btn-color, 3);
			}
			&.alt {
				background: $btn-alt-color;
				&:hover {
					background: darken($btn-alt-color, 3);
				}
			}
		}
	}
	.error {
		padding: 15px;
		margin: 0;
	}
	.pagination {
		display: flex;
		align-items: center;
		padding: 25px 0;
		a {
			display: inline-flex;
			text-decoration: none;
			background-color: #758497;
			font-size: 14px;
			font-weight: 600;
			color: #fff;
			border-radius: 4px;
			padding: 7px 10px;
			&:hover {
				background-color: darken(#758497, 3);
			}
			&:first-child {
				margin-right: 10px;
			}
			&:last-child {
				margin-left: 10px;
			}
		}
		span {
			font-weight: 600;
		}
	}
}
@media screen and (max-width: 1000px) {
	header {
		padding-left: 0;
	}
	.responsive-hidden {
		display: none;
	}
	.responsive-width-100 {
		width: 100% !important;
	}
	.responsive-flex-column {
		flex-flow: column;
	}
	main {
		padding: 70px 7px 20px 7px;
		.content-block {
			padding: 5px;
		}
		.dashboard {
			flex-flow: column;
			.stat {
				width: 100%;
			}
		}
	}
}