/*
Name: 			Theme Base
Written by: 	Okler Themes - (http://www.okler.net)
Theme Version: 	@@version
*/

html,
body {
	background: $body-color;
	width: 100%;
}

html {
	overflow-x: hidden !important;
	overflow-y: scroll !important;
}

body {
	color: #777;
	font-family: $font-primary;
	line-height: 22px;
	margin: 0;
	font-size: $body-font-size + 0px;
}

a {
	color: $color-primary;
}

a:hover, a:focus {
	color: lighten($color-primary, 5% );
}

a:active {
	color: darken($color-primary, 5% );
}

// LAYOUT STYLE - SCROLL
// -----------------------------------------------------------------------------

/* Layout Base - Main Wrapper  */
.body {
	min-height: 100vh;
	width: 100%;
}

// HEADER
// -----------------------------------------------------------------------------

/* Layout Base - Header */
.header {
	height: 60px;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
}

// INNER WRAPPER
// -----------------------------------------------------------------------------

/* Layout Base - Inner Wrapper */
.inner-wrapper {
	display: table;
	min-height: 100vh;
	padding-top: 60px;
	table-layout: fixed;
	overflow: hidden;
	width: 100%;
}

// MAIN CONTENT
// -----------------------------------------------------------------------------

/* Layout Base - Content Body */
.content-body {
	display: table-cell;
	padding: 40px;
	position: relative;
	vertical-align: top;

	&:not(.card-margin) {
		> .row + .row {
			padding-top: 40px;
			@media(max-width: 767px) {
				padding-top: 15px;
			}
		}
	}

	&.card-margin {
		padding-top: 0;
		.page-header {
			margin-bottom: 5px;
		}
		.card {
			margin-top: 40px;
			@media(max-width: 767px) {
				margin-top: 15px;
			}
		}
	}
}

// PAGE HEADER
// -----------------------------------------------------------------------------

/* Layout Base - Page Header */
.page-header {
	background: #171717;
	border-bottom: none;
	border-left: 1px solid #3A3A3A;
	box-shadow: 1px (4px - 1) 0 1px #CCCCCC;
	height: 50px;
	margin: (-40px) (-40px) 40px (-40px);
	padding: 0;
}

// SIDEBAR LEFT
// -----------------------------------------------------------------------------

/* Layout Base - Sidebar Left */
.sidebar-left {
	color: $color-default-inverse;
	display: table-cell;
	position: relative;
	vertical-align: top;
	width: 300px;
	z-index: 1010;
}

/* Layout Base - Sidebar Left Opened ( Larger than mobile ) */
@media only screen and (min-width: 768px) {
	html.sidebar-left-collapsed {
		.sidebar-left {
			width: 73px;
		}
	}
}

// SIDEBAR RIGHT
// -----------------------------------------------------------------------------

/* Layout Base - Sidebar Right */
.sidebar-right {
	background: #171717;
	bottom: 0;
	margin-right: -300px;
	min-height: 100vh;
	position: fixed;
	right: 0;
	top: 0;
	width: 300px;
}

/* Layout Base - Sidebar Right Opened ( Larger than mobile ) */
@media only screen and (min-width: 768px) {
	html.sidebar-right-opened {
		.header {
			margin-left: -300px;
			margin-right: 300px;
		}

		.inner-wrapper {
			margin-left: -300px;
		}

		.sidebar-right {
			margin-right: 0;
		}

		&.has-top-menu:not(.has-left-sidebar-half) {
			.inner-wrapper {
				margin-left: 0;
				padding-right: 300px;
			}
		}
	}
}

/* Layout Base - Sidebar Right Opened - Has Top Horizontal Menu ( Ipad ) */
@media only screen and (min-width: 768px) and (max-width: 991px) {
	html.sidebar-right-opened {
		&.has-top-menu:not(.has-left-sidebar-half) {
			.content-body {
				right: 300px;
			}
		}
	}
}

// FLEXBOX SUPPORTED
// -----------------------------------------------------------------------------

/* Layout Base - Flexbox supported */
@media only screen and (min-width: 768px) {
	html.flexbox,
	html.flexboxlegacy {
		.inner-wrapper {
			display: flex;
		}

		.sidebar-left,
		.content-body {
			display: block;
			flex-shrink: 0;
		}

		.content-body {
			flex: 2;
			min-width: 1px;
		}

		/* Tab Navigation */
		&.has-tab-navigation {
			.inner-wrapper {
				flex-direction: column;
			}
		}
	}
}

// LAYOUT STYLE - FIXED
// -----------------------------------------------------------------------------

/* Layout Fixed */
@media only screen and (min-width: 768px) {

	/* Layout Fixed - Reseting Styles */
	html.fixed {
		.inner-wrapper,
		.sidebar-left,
		.content-body {
			display: block;
		}
	}

	/* Layout Fixed - Header */
	html.fixed {
		.header {
			position: fixed;
			z-index: 1020;
		}
	}

	/* Layout Fixed - Inner Wrapper */
	html.fixed {
		.inner-wrapper {
			padding-top: 60px + 50px;
		}
	}

	/* Layout Fixed - Content Body */
	html.fixed {
		.content-body {
			margin-left: 300px;

			&.has-toolbar {
				padding-top: 40px + 52px;
			}
		}

		&.has-top-menu:not(.has-left-sidebar-half) {
			.content-body {
				margin-left: 0;
			}
		}
	}

	/* Layout Fixed - Page header */
	html.fixed {
		.page-header {
			left: 300px;
			margin: 0;
			position: fixed;
			right: 0;
			top: 60px;
		}

		&.has-top-menu:not(.has-left-sidebar-half) {
			.page-header {
				left: 0;
			}
		}
	}

	/* Layout Fixed - Sidebar Left */
	html.fixed {
		.sidebar-left {
			bottom: 0;
			left: 0;
			padding-bottom: 50px;
			position: fixed;
			top: 60px;

			.nano-content {
				padding-bottom: 50px;
			}
		}
	}

	/* Layout Fixed - Sidebar Left Collapsed */
	html.fixed.sidebar-left-collapsed {
		.page-header {
			left: 73px;
		}

		.content-body {
			margin-left: 73px;
		}
	}

	/* Layout Fixed - Sidebar Right Opened */
	html.fixed.sidebar-right-opened {
		.page-header {
			left: 0;
			margin-right: 300px;
		}

		.sidebar-left {
			left: -300px;
		}
	}

	/* Layout Fixed - Sidebar Left Collapsed & Sidebar Right Opened */
	html.fixed.sidebar-left-collapsed.sidebar-right-opened {
		.page-header {
			left: -300px;
		}
	}
}

// LAYOUT STYLE - BOXED
// -----------------------------------------------------------------------------

/* Layout Boxed - small than min-width */
@media only screen and (max-width: 1199px) {
	html.boxed {
		.header {
			border-color: $color-primary;
		}
	}
}
/* Layout Boxed - larger or equal min width */
@media only screen and (min-width: 1200px) {

	/* Layout Boxed - Body Tag */
	html.boxed {
		body {
			background: url(../img/patterns/gray_jean.png) repeat;
			padding-bottom: 5px;
		}
	}

	/* Layout Boxed - Main Wrapper */
	html.boxed {
		.body {
			position: relative;
			max-width: 1200px;
			margin: 0 auto;
			padding-top: 25px;
			background-color: transparent;
		}
	}

	/* Layout Boxed - Header */
	html.boxed {
		.header {
			border-top: 3px solid $color-primary;
			height: 60px;
			position: absolute;
			top: 25px;
		}
	}

	/* Layout Boxed - Inner Wrapper */
	html.boxed {
		.inner-wrapper {
			padding-top: 60px;
			margin-bottom: 20px;
			border-radius: 5px;
			box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
		}
	}

	/* Layout Boxed - Content Body */
	html.boxed {
		.content-body {
			background-color: $body-color;
		}
	}

	/* Layout Boxed - Base */
	html.boxed {
		.header {
			border-radius: 5px 5px 0 0;
		}

		.sidebar-left {
			border-radius: 0 0 0 5px;
			position: relative;
			margin-bottom: 0;
		}

		.content-body {
			border-radius: 0 0 5px 0;
		}

		.sidebar-right {
			border-radius: 0 5px 5px 0;
		}
	}

	/* Layout Boxed - Sidebar Right */
	html.boxed {
		.sidebar-right {
			border-top: 3px solid $color-primary;
			min-height: 0;
		}
	}

	/* Layout Boxed - Sidebar Right Opened */
	html.boxed.sidebar-right-opened {
		.body {
			overflow: hidden;
		}

		.header {
			border-radius: 5px 0 0 0;
		}

		.content-body {
			border-radius: 0 0 0 5px;
		}

		.sidebar-right {
			bottom: 20px;
			position: absolute;
			top: 25px;
			border-radius: 0 5px 5px 5px;
		}
	}
}
/* Layout Boxed - larger or equal min width */
@media only screen and (min-width: 768px) {
	/* Layout Boxed - Content Body */
	html.boxed:not(.sidebar-left-big-icons):not(.has-top-menu):not(.has-tab-navigation):not(.left-sidebar-panel) {
		&.sidebar-left-collapsed {
			.content-body {
				width: calc(100% - 73px);
			}
		}
		&.left-sidebar-panel {
			.content-body {
				width: calc(100% - 375px);
			}
			&.sidebar-right-opened {
				.content-body {
					width: calc(100% - 350px);
				}	
			}
		}
		.content-body {
			width: calc(100% - 300px);
			flex: none;
		}
	}
}

// LAYOUT MOBILE
// -----------------------------------------------------------------------------

@media only screen and (max-width: 767px) {
	html,
	body {
		background: $body-color;
	}

	html.mobile-device {
		.sidebar-left,
		.sidebar-right {
			overflow-y: scroll;
			overflow-x: hidden;
			-webkit-overflow-scrolling: touch;
		}
	}

	body {
		min-height: 100vh;
	}

	.inner-wrapper,
	.sidebar-left,
	.content-body {
		display: block;
	}

	.body {
		min-height: 0;
		overflow: visible;
	}

	.header {
		background: none;
		border: none;
		height: auto;
		position: static;

		.logo-container {
			height: 60px;
			left: 0;
			position: fixed;
			right: 0;
			top: 0;
			z-index: 99;
		}

		.header-right {
			background: #FFF;
			float: none !important;
			height: 60px;
			margin-top: 60px;
			width: 100%;
		}
	}

	.inner-wrapper {
		min-height: 0;
		padding-top: 0;
	}

	.content-body {
		padding: 0 15px 15px;
	}

	.page-header {
		margin: 0 -15px 20px;
	}

	.sidebar-left {
		bottom: 0;
		left: -100%;
		min-height: 0;
		min-width: 100%;
		min-width: 100vw;
		padding-top: 60px;
		padding-bottom: 50px;
		position: fixed;
		overflow: hidden;
		top: 0;
		z-index: 98 !important;
	}

	.sidebar-right {
		bottom: 0;
		left: auto;
		right: -100%;
		min-height: 0;
		margin-right: 0;
		min-width: 100%;
		min-width: 100vw;
		top: 0;
		z-index: 100;
	}

	html.csstransforms {
		.sidebar-left,
		.sidebar-right {
			transition-property: margin;
			transition-duration: .25s;
			transition-timing-function: ease-out;
			transition-delay: 0;
		}
		.sidebar-left {
			margin-left: -25px;
		}

		.sidebar-right {
			margin-right: -25px;
		}
	}

	/* If desktop is seeing mobile res, fix scrollbars */
	html.no-mobile-device {
		body {
			min-height: 0;
		}

		.body {
			min-height: 100vh;
			overflow: hidden;
		}

		.inner-wrapper {
			overflow-y: auto;
		}

		&.sidebar-left-opened,
		&.sidebar-right-opened {
			&,
			& body {
				overflow: hidden;
			}
		}
	}

	/* Layout Mobile - Sidebar Left Opened */
	html.sidebar-left-opened {
		&.no-csstransforms {
			.sidebar-left {
				left: 0;
			}
		}

		&.csstransforms {
			.sidebar-left {
				margin-left: 100%;
			}
		}
	}

	/* Layout Mobile - Sidebar Right Opened */
	html.sidebar-right-opened {
		&.no-csstransforms {
			.sidebar-right {
				right: 0;
			}
		}

		&.csstransforms {
			.sidebar-right {
				margin-right: 100%;
			}
		}
	}

	/* Layout Mobile - Sidebar Left Collapsed & Sidebar Right Opened */
	html.sidebar-left-collapsed.sidebar-right-opened {
		.sidebar-left {
			margin-left: -300px;
		}
	}
}

/* iOS10 Content Width Fix */
@media (min-width: 768px) {
	html.mobile-device.flexbox:not(.has-tab-navigation) .content-body {
		width: calc(100vw - 300px) !important;
	}
}

// INNER LAYOUT - WITH MENU
// -----------------------------------------------------------------------------

/* Content With Menu - Boxed Layout Fixing Spacement on Bottom */
@media only screen and (min-width: 1200px) {
	html.boxed {
		.content-with-menu {
			margin-bottom: -(40px);
		}
	}
}

/* Content With Menu - Container */
@media only screen and (min-width: 768px) {
	.content-with-menu-container {
		display: table;
		table-layout: fixed;
		width: 100%;
	}
}

/* Content With Menu - Menu Faux Column for Scroll and Boxed Layouts */
@media only screen and (min-width: 768px) {
	html.scroll,
	html.boxed {
		.content-with-menu {
			&:before {
				bottom: -(50px - 3);
				content: '';
				display: block;
				left: 0;
				position: absolute;
				top: (50px + 4);
				width: 300px;
			}

			&:after {
				bottom: -(50px - 4);
				content: '';
				display: block;
				left: -1px;
				position: absolute;
				top: (50px + 4);
				width: 1px;
				z-index: 3;
			}
		}
	}

	html.boxed {
		.content-with-menu {
			&:before {
				bottom: 0;
			}

			&:after {
				bottom: 2px;
			}
		}

	}
}

// CONTENT WITH MENU
// -----------------------------------------------------------------------------

.content-with-menu {
	margin: -20px -15px 0;
}

/* Content With Menu - Responsive */
@media only screen and (max-width: 767px) {
	.content-with-menu {
		clear: both;
	}

	.inner-body {
		padding: 40px 15px 0;
	}
}

/* Content With Menu - Menu and Body */
@media only screen and (min-width: 768px) {
	.content-with-menu {
		border-top: (60px + 50px) solid transparent;
		margin: (-(60px + 50px + 40px)) (-40px) (-(50px + 3)) (-40px);
		min-height: 100vh;
	}

	.inner-menu {
		display: table-cell;
		vertical-align: top;
	}

	.inner-body {
		display: table-cell;
		vertical-align: top;
		padding: 40px;
	}

	.inner-toolbar {
		height: 52px;
		overflow: hidden;
	}

	.content-with-menu-has-toolbar {
		.inner-menu-toggle {
			border-radius: 0;
		}
		.inner-toolbar {
			padding-left: 140px;
		}
	}
}

// FLEXBOX SUPPORTED
// -----------------------------------------------------------------------------

/* Content With Menu - Flexbox supported */
@media only screen and (min-width: 768px) {
	html.flexbox,
	html.flexboxlegacy {
		.content-with-menu-container {
			display: flex;
		}

		.inner-menu,
		.inner-body {
			display: block;
			flex-shrink: 0;
		}

		.inner-body {
			flex: 2;
		}
	}
}

/* Content With Menu + Layout Fixed */
@media only screen and (min-width: 768px) {
	html.fixed {
		.content-with-menu-container,
		.inner-menu,
		.inner-body {
			display: block;
		}

		.content-with-menu-container {
			position: relative;
		}

		.inner-menu-toggle {
			position: absolute;
			top: 60px + 50px + 4;
			border-radius: 0 0 $border-radius 0;
			width: 140px;
			z-index: 1002;
		}

		.inner-menu {
			bottom: 0;
			display: block;
			left: 300px;
			position: fixed;
			margin: 0;
			top: 60px + 50px + 4;
			width: 300px;
			padding: 35px;
			z-index: 1002;
		}

		.inner-menu-content {
			display: block;
		}

		.inner-body {
			margin-left: 300px;
			border-top: (60px + 50px + 3) solid transparent;
			margin-top: -110px;
			min-height: 100vh;
			position: relative;
		}

		.content-with-menu-has-toolbar .inner-body {
			border-top-width: (60px + 50px + 52px + 3);
		}
	}
}

/* Content With Menu + Layout Scroll & Boxed */
@media only screen and (min-width: 768px) {
	html.scroll,
	html.boxed {
		.inner-menu,
		.inner-body {
			display: block;
		}

		.content-with-menu-container {
			position: relative;
		}

		.inner-menu-toggle {
			position: absolute;
			top: 0;
			border-radius: 0 0 $border-radius 0;
			width: 140px;
			z-index: 3;
		}

		.inner-menu {
			display: block;
			position: relative;
			margin: 0;
			width: 300px;
			padding: 35px;
		}

		.inner-menu-content {
			display: block;
		}

		.inner-body {
			margin-left: 0;
			min-height: 100vh;
			position: relative;
		}

		&.flexbox,
		&.flexboxlegacy {
			.content-with-menu-container {
				display: flex;
			}
		}
	}
}

/* Content With Menu + Layout Fixed + Sidebar Left Collapsed */
@media only screen and (min-width: 768px) {
	html.fixed.sidebar-left-collapsed {
		.inner-menu,
		.inner-menu-toggle,
		.inner-toolbar {
			left: 73px;
		}

		&.inner-menu-opened {
			.inner-menu-toggle,
			.inner-toolbar {
				left: 73px + 300px;
			}
		}
	}
}

/* Content With Menu + Layout Fixed + Sidebar Right Opened */
@media only screen and (min-width: 768px) {
	html.fixed.sidebar-right-opened {
		.inner-menu,
		.inner-menu-toggle,
		.inner-toolbar {
			left:  -(300px - 300px);
		}

		.inner-toolbar {
			margin-right: 300px;
		}

		&.inner-menu-opened {
			.inner-menu-toggle,
			.inner-toolbar {
				left:  -(300px - 300px + 300px);
			}
		}
	}
}

/* Content With Menu + Layout Fixed + Sidebar Left Collapsed + Sidebar Right Opened */
@media only screen and (min-width: 768px) {
	html.fixed.sidebar-left-collapsed.sidebar-right-opened {
		.inner-menu,
		.inner-menu-toggle,
		.inner-toolbar {
			left:  -(300px - 73px);
		}

		&.inner-menu-opened {
			.inner-menu-toggle,
			.inner-toolbar {
				left:  -(300px - 73px + 300px);
			}
		}
	}
}

/* Resolution gt 767 and lt 1366 - Hide Inner Menu */
@media only screen and (min-width: 768px) and (max-width: 1365px) {
	html.fixed,
	html.scroll,
	html.boxed {
		.inner-menu {
			display: none;
		}
		.inner-menu-toggle {
			display: block;
		}
		.inner-body {
			margin-left: 0;
		}

		.content-with-menu-has-toolbar {
			.inner-toolbar {
				padding-left: 140px;
			}
		}

		&.inner-menu-opened {
			.inner-menu {
				display: block;
			}
			.inner-menu-toggle {
				display: none;
			}
			.inner-body {
				margin-right: -300px;
			}
			.content-with-menu-has-toolbar {
				.inner-toolbar {
					padding-left: 0;
				}
			}
		}
	}

	html.fixed.inner-menu-opened {
		.inner-body {
			margin-left: 300px;
		}
	}

	html.scroll,
	html.boxed {
		.content-with-menu {
			&:before {
				display: none;
			}
		}

		&.inner-menu-opened {
			&:before {
				display: block;
			}
		}
	}
}

/* Resolution gt 1366 - Show Inner Menu */
@media only screen and (min-width: 1366px) {
	html.fixed,
	html.scroll,
	html.boxed {
		.inner-menu {
			display: block;
		}
		.inner-menu-toggle,
		.inner-menu-toggle-inside {
			display: none;
		}
		.inner-body {
			margin-right: 0;
		}
		.content-with-menu-has-toolbar {
			.inner-toolbar {
				padding-left: 0;
			}
		}
	}

	html.fixed.inner-menu-opened {
		.inner-body {
			margin-left: 300px;
		}
	}

	html.fixed,
	html.fixed.inner-menu-opened {
		.content-with-menu .inner-toolbar {
			left: 300px + 300px;
		}

		.inner-menu-toggle,
		.inner-menu {
			left: 300px;
		}
	}

	html.fixed.sidebar-right-opened {
		.content-with-menu .inner-toolbar {
			left: 300px + 300px - 300px;
		}

		.inner-menu,
		.inner-menu-toggle {
			left: 300px - 300px;
		}
	}

	html.fixed.sidebar-left-collapsed,
	html.fixed.sidebar-left-collapsed.sidebar-right-opened.inner-menu-opened,
	html.fixed.sidebar-left-collapsed.inner-menu-opened {
		.content-with-menu .inner-toolbar {
			left: 73px + 300px;
		}

		.inner-menu-toggle,
		.inner-menu {
			left: 73px;
		}
	}

	html.fixed.sidebar-left-collapsed.sidebar-right-opened {
		.content-with-menu .inner-toolbar {
			left: 73px - 300px + 300px;
		}

		.inner-menu,
		.inner-menu-toggle {
			left: 73px - 300px;
		}
	}

}

/* Fix IE Scrollbar Overlaying content */
@-ms-viewport {
	width: auto !important;
}