@import "variables";
.cp-creditbills {}
.cp-creditbills__head {
	margin-bottom: 16px;
	.title {
		margin-bottom: 8px;
		font-size: 18px;
		font-weight: bold;
	}
	.description {
		margin: 0 0 8px;
		padding: 0;
		list-style: none;
		font-size: 16px;
		a {
			border-bottom-color: transparent;
			&:hover {
				border-bottom-color: $blue;
			}
			&.color-danger {
				&:hover {
					border-bottom-color: $red;
				}
			}
		}
	}
	.box {
		position: relative;
	}
	.status {
		@media(min-width: 992px){
			margin-top: -16px;
		}
		margin-bottom: 8px;
		.label {
			@include border-radius(0);
		}
	}

	.pull-left {
		@media (min-width: 768px){
			width: 70%;
		}
	}
	.pull-right {}
}

.cp-creditbills__body {
	.cpc-table-status {
		margin-bottom: 16px;
		.alert {
			padding: 3px 8px 2px;
			@include border-radius(0);
		}
	}
	.cpc-table {
		font-size: 12px;
		.cpc-table__row {
			border-bottom: 1px solid $color_gray_10;
			.cpc-table__col {
				float: left;
				&.main {
					width: 50%;
					padding: 8px;
					@media (max-width: 991px){
						width: 100%;
					}
				}
				&.rows {
					width: 50%;
					@media (max-width: 991px){
						width: 100%;
					}
					.cpc-table__col {
						width: 25%;
						padding: 8px;
						/*padding-top: 0;
						padding-bottom: 0;*/
						@media (max-width: 767px){
							padding-top: 0;
						}
						&.item {
							width: 20%;
							@media (max-width: 767px){
								width: 50%;
							}
							a {
								border-color: transparent;
							}
						}
						&.price {
							width: 20%;
							text-align: right;
							@media (max-width: 767px){
								width: 50%;
							}
						}
						&.commission {
							width: 40%;
							text-align: right;
							@media (max-width: 767px){
								width: 70%;
								text-align: left;
							}
							visibility: hidden;
							opacity: 0;
						}
						&.summary {
							width: 20%;
							text-align: right;
							@media (max-width: 767px){
								width: 30%;
							}
						}
					}
				}
			}
			&.head {
				background: lighten($color_gray_20, 5%);
				font-size: 11px;
				line-height: normal;
				small {
					display: block;
					font-size: 10px;
					@media (max-width: 1299px){
						display: none;
					}
				}
				.cpc-table__col {
					&.rows {
						@media (max-width: 991px){
							display: none;
						}
						.cpc-table__col {
							/*padding-top: 0;
							padding-bottom: 0;*/
							&.commission {
								visibility: visible;
								opacity: 1;
							}
						}
					}
				}
			}

			&.active {
				//background: lighten($color_gray_10, 5%);
				background: $yellow_light !important;
				.cpc-table__col {
					&.rows {
						.cpc-table__col {
							&.commission {
								visibility: visible;
								opacity: 1;
							}
						}
					}
				}
				.cpc-table__reason {
					display: block;
				}
				.cpc-table__comment {
					display: block;
				}
			}
			&:not(.head):hover {
				background: $color_water;
			}

			&.created {
				color: $color_gray_40;
				a {
					color: $color_gray_40;
					&:hover {
						color: $blue;
					}
				}
			}

			&.row-error {
				outline: 4px solid $color_danger;
			}
		}

		select.form-control {
			height: 24px;
			padding: 0 4px;
			font-size: 12px;
		}

		.cpc-table__label {
			@media(min-width: 992px){ display: none; }
			font-size: 11px;
			font-weight: bold;
		}

		.cpc-table__product {
			padding-left: 20px;
			.title {
				margin-left: -20px;
			}
			a.title-link {
				border: none;
				position: relative;
				display: inline-block;
				padding-left: 20px;
				.title-link__ico {
					position: absolute; top: 50%; left: 0;
					@include transform(translateY(-50%));
				}
			}
		}

		.cpc-table__reason {
			display: none;
			max-width: 600px;
			margin: 0;
			padding-top: 4px;
			.media-body {}
			.media-right {
				padding-left: 8px;
			}
			.cpc-table-reason {}
			.cpc-table-reason-link, a.cpc-table-reason-link {
				border: none;
				display: block;
				font-size: 11px;
				line-height: normal;
				white-space: nowrap;
				color: rgba(13,97,171,0.75);
				@include transition(none);
				strong {
					display: block;
				}
				&:hover {
					color: $color_primary;
				}
			}
			@media (max-width: 575px){
				.media-body { display: block; width: auto; }
				.media-right { display: block; width: auto; margin: 0px; padding: 4px 0 0 0; }
				.cpc-table-reason-link {
					white-space: normal;
					strong { display: inline-block; }
				}
			}
		}

		.cpc-table__comment {
			display: none;
			padding-top: 4px;
			.comment-links {
				span {
					//color: lighten($color_primary, 20%);
					color: rgba(13,97,171,0.75);
					&:hover {
						color: $color_primary;
						cursor: pointer;
					}
				}
				.comment-add {}
				.comment-edit {
					display: none;
				}
			}
			.comment-text {}
			.comment-form {
				display: none;
				.form-control {
					font-size: 12px;
				}
				.form-group {
					margin-bottom: 8px;
				}
			}
			&.open {
				.comment-links {
					display: none;
				}
				.comment-text {
					display: none;
				}
				.comment-form {
					display: block;
				}
			}
			&.active {
				.comment-links {
					.comment-add {
						display: none;
					}
					.comment-edit {
						display: inline-block;
					}
				}
			}
		}

		.cpc-table-commission {
			position: relative;
			margin-top: -3px;
			padding-right: 36px;
			.count {
				position: absolute; top: 3px; right: 0;
			}
			&.active {
				background: $color_water;
			}
		}

		.cpc-table-commission-copy {
			padding-top: 4px;
			font-size: 11px;
		}
	}

	.cpc-table-bottom {
		padding-top: 8px;
		.pull-left {
			width: 520px;
			margin-bottom: 8px;
		}
		.pull-right {
			width: 360px;
			margin-bottom: 8px;
		}
		@media (max-width: 767px){
			.pull-left, .pull-right {
				width: 100%;
				float: none;
			}
		}
	}

	.cpc-total-table {
		width: 100%;
		font-size: 12px;
		font-weight: bold;
		td {
			padding: 4px 8px;
			&:not(:first-child){
				text-align: right;
			}
		}
		tr:not(:first-child) {
			td {
				border-top: 1px solid $color_gray_10;
			}
		}
	}

	.cpc-creator {
		position: relative;
		margin: 0 -4px;
		padding: 0;
		list-style: none;
		font-size: 12px;
		li {
			display: inline-block;
			vertical-align: top;
			padding: 0 4px 4px;
			@media (max-width: 575px) {
				display: block;
			}
		}
		.form-label {
			padding-top: 6px;
		}
		.form-control {
			padding: 4px 8px;
			height: 30px;
		}
		.btn {
			padding: 4px 8px;
		}
		.jui-datepicker-box {
			max-width: 125px;
		}
	}

	.cpc-paymentHistory-table {
		width: 100%;
		font-size: 11px;
		th {
			background: $color_gray_10;
			padding: 2px 4px;
			font-weight: normal;
			vertical-align: top;
		}
		td {
			border-bottom: 1px solid $color_gray_10;
			padding: 4px;
			vertical-align: top;
		}
		tr:not(.bottom):hover td {
			background: $color_water;
		}
		tr.bottom {
			td {
				border-bottom: none;
			}
		}
		.form-control {
			min-width: 125px;
			padding: 4px 8px;
			height: 30px;
		}
		.btn {
			padding: 4px 8px;
		}
		.label {
			@include border-radius(0);
		}
		.userpic-w-buts {
			position: relative;
			display: inline-block;
			padding-right: 20px;
			.pic {
				display: inline-block;
			}
		}
	}

	//
	.cpc-application {
		font-size: 12px;

		.cpc-application__head {
			font-size: 12px;
		}
		.cpc-application__body {
			display: none;
			&.open {
				.cpc-application__form .cpc-application__messager-toggler {
					display: none;
				}
				.cpc-application__messager {
					display: block !important;
				}
			}
		}

		.cpc-application__form {
			float: left;
			width: 40%;
			@media (max-width: 991px){
				float: none;
				width: auto;
			}
			.cpc-application__messager-toggler {
				@media (min-width: 992px){
					position: absolute; top: 8px; left: 100%;
					margin-left: 32px;
					white-space: nowrap;
				}
				color: $blue;
				border-bottom: 1px dashed $blue;
				&:hover {
					border-bottom-color: transparent;
					cursor: pointer;
				}
			}
		}
		.cpc-application__messager {
			float: left;
			width: 50%;
			padding-left: 16px;
			display: none;
			@media (max-width: 1499px){
				width: 60%;
			}
			@media (max-width: 991px){
				float: none;
				width: auto;
				padding: 16px 0 0 0;
			}
			.cpc-application__messager-toggler {
				float: right;
				border-bottom-color: transparent;
			}
			.messager-form {
				margin-bottom: 24px;
				.nav-tabs {
					border: none;
					li {
						margin: 0;
						a {
							border: none;
							font-weight: bold;
							color: $color_black;
							@include border-radius(0);
						}
						&.active {
							a {
								background: $color_mystic;
							}
						}
					}
				}
				.tab-content {
					border: 4px solid $color_mystic;
					padding: 12px;
				}
				.col-bord {
					@media (min-width: 768px) {
						border-left: 1px solid $color_gray_10;
					}
					@media (max-width: 767px) {
						margin-top: 8px;
						padding-top: 8px;
						border-top: 1px solid $color_gray_10;
					}
					.label {
						padding: 2px 4px;
						@include border-radius(0);
					}
				}
			}
			.messager-list {
				.message {
					&:not(:first-child){
						margin-top: 16px;
					}
					.message__head {
						margin-bottom: 12px;
					}
					.message__body {
						background: $color_mystic;
						position: relative;
						padding: 16px;
						&:before {
							content: '';
							position: absolute; top: -8px; left: 0;
							border: 8px solid transparent;
							border-left-color: $color_mystic;
						}
					}
					&.success {
						.message__body {
							background: $green_light;
							&:before {
								border-left-color: $green_light;
							}
						}
					}
				}
			}
		}

		&.open {
			.cpc-application__head {
				display: none;
			}
			.cpc-application__body {
				display: block;
			}
		}
	}
}

.cp-creditbills-sort {
	display: flex;
	@media(max-width: 991px){
		flex-direction: column;
	}
	.sort-left {
		flex-grow: 1;
	}
	.sort-right {
		@media(min-width: 992px){
			padding-left: 16px;
		}
		min-width: 220px;
	}

	.sort-buttons {
		min-width: 220px;
		margin: 0 0 16px 0;
		padding: 0;
		list-style: none;
		text-align: center;
		white-space: nowrap;
		@media (max-width: 991px){
			margin-bottom: 0;
		}
		& > li {
			&:first-child {
				margin-bottom: 42px;
				@media (max-width: 991px){
					margin-bottom: 16px;
				}
			}
		}
	}
}

.cp-creditbills-list {
	font-size: 12px;
	.table {
		font-size: 11px;
		.thead-dark {
			td, th {
				background: $color_gray_20;
			}
		}
		th, td {
			vertical-align: top;
			padding: 4px 6px;
		}
		.js-table-sort {
			display: inline-block;
			.js-table-sort-arr {
				top: 0;
				margin-top: 0;
			}
		}
		.list-table-links {
			margin: 0;
			padding: 0;
			list-style: none;
			font-weight: bold;
			white-space: nowrap;
			text-align: right;
			li {
				display: inline-block;
				vertical-align: top;
				&:not(:first-child){
					border-left: 1px solid $color_gray_30;
					margin-left: 3px;
					padding-left: 4px;
				}
			}
		}
	}
}