@page {
	margin: 0
}

* {
	margin: 0;
	padding: 0;
}

body {
	margin: 0;
	font-family: Lucida Grande,Lucida Sans Unicode,Lucida Sans,Geneva,Verdana,sans-serif;
	font-size: 13px;
	line-height: 20px;
}

.sheet {
	margin: 0;
	position: relative;
	box-sizing: border-box;
	page-break-after: always;
	width: 210mm;
	min-height: 296mm;
	padding: 10mm;
	overflow: visible;
	height: auto;
}

@media screen {
	body { background: #e0e0e0 }
	.sheet {
		background: white;
		box-shadow: 0 .5mm 2mm rgba(0,0,0,.3);
		margin: 5mm auto;
	}
}

@media print {
	body { width: 210mm }
}

.footer {
	text-align: center;
	max-width: 500px;
	margin: 0 auto;
	font-size: 13px;
	color: #999;
}

.header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #E24848;
	padding: 20px 0;
	margin: 0 0 10px 0;

	.logo {
		width: 70px;
		height: 70px;
		background: #E24848;
		line-height: 70px;
		color: #fff;
		text-align: center;
		font-size: 12px;
	}
}

h1.title {
	font-size: 40px;
	font-weight: bold;
}

.subtitle {
	text-align: left;
	padding: 20px 0 0 0;
	margin: 0 0 0 0;
	font-size: 30px;
	font-weight: normal;
	color: #868789;
}

.sub-header {
	display: flex;
	line-height: 1.3;
	padding-bottom: 20px;

	.seller, .buyer {
		width: 50%;
	}

	.seller p {
		color: #868789;
		padding: 15px 0 0 0;
		font-size: 12px;

		strong {
			text-transform: uppercase;
			font-size: 11px;
		}
	}

	h2 {
		margin: 0 0 5px 0;
	}

	h3 {
		margin: 0 0 20px 0;
	}
}

h3 {
	text-transform: uppercase;
	font-size: 10px;
	color: #868789;
}

.info {
	display: flex;
	margin: 0 0 20px 0;
	border-top: 1px solid #E24848;
	border-bottom: 1px solid #E24848;
	padding: 10px 0;

	ul {
		display: flex;
		flex-wrap: wrap;
		list-style-type: none;
		margin: 0;
		padding: 0;
		line-height: 1.3;

		li {
			width: 50%;
			list-style-type: none;
			margin: 0;
			padding: 0;

			strong {
				text-transform: uppercase;
				color: #868789;
				font-size: 11px;
			}
		}
	}
}

.invoice-body {
	display: flex;
	flex-direction: column;

	.grand-total {
		order: 1;
		text-align: right;
		padding-bottom: 20px;

		strong {
			color: #E24848;
			text-transform: uppercase;
			font-size: 11px;
		}

		span {
			font-size: 30px;
		}
	}

	.total {
		order: 3;
	}
}

table.line-items {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	order: 2;
	margin: 0 0 20px 0;

	thead {
		font-weight: bold;

		th {
			background: #F0F1F1;
			border-top: 1px solid #000;
			text-transform: uppercase;
			text-align: right;
			padding: 10px 5px;
			font-size: 11px;

			&:nth-child(2) {
				text-align: left;
				padding-left: 0;
			}
		}
	}

	tbody {

		tr:nth-child(2n+1) {
			background: #fff;
		}

		tr.item-note {
			td {
				border-top: none;
				padding: 0 0 5px 5px;
				color: #868789;
			}
		}

		tr.has-note td {
			padding: 10px 5px 0 5px;
		}

		tr:last-child td {
			border-bottom: 1px solid #C5C6C8;
		}

		td {
			text-align: right;
			padding: 10px 5px;
			border-top: 1px solid #C5C6C8;
			color: #868789;

			&:first-child {
				color: #E24848;
			}

			&:nth-child(3),
			&:last-child {
				color: #000;
			}

			&:nth-child(2) {
				text-align: left;

				span {
					display: block;
					color: #000;
				}

				.note {
					font-size: 11px;
					font-style: italic;
				}
			}
		}
	}

	tfoot {
		font-weight: bold;
		text-align: right;

		tr td {
			padding: 10px 5px;
		}

		tr td:first-child {
			text-align: left;
			padding-left: 0;
		}
	}
}

.total {
	text-align: right;
	padding: 10px 0 10px 0;
	border-top: 1px solid #E24848;
	border-bottom: 1px solid #E24848;

	th {
		text-transform: uppercase;
		color: #868789;
		font-size: 11px;
	}

	h2 {
		font-weight: normal;
		margin: 0 0 10px 0;
	}

	h3 {
		font-weight: bold;
		color: #00ADEF;
		font-size: 20px;
	}
}

.invoice-note {
	padding-top: 10px;

	p {
		margin: 0 0 10px 0;
		font-style: italic;
	}
}

.debug {
	margin: 0 auto;
	padding: 20px;
	width: 600px;

	textarea {
		width: 100%;
		padding: 20px;
		box-sizing: border-box;
		height: 200px;
		background: rgba(255,255,255,0.5);
		border: 1px solid rgba(0,0,0,0.2);
	}
}

