<?php defined('BASEPATH') OR exit('No direct script access allowed');
	
	$bgColor = empty($printcolor) ? '#208ED3' : $printcolor;
	$borderColor = empty($borderColor) ? '#000000' : $borderColor; // #6D6C6C
	$foreColor = empty($foreColor) ? '#FFF' : $foreColor;
	$email_color = empty($color) ? '#208ED3' : $color;
	if ($isPrint)
	{
		if ($printcolor == 'transparent')
		{
			$foreColor = "#000000";
			$borderColor = "#333333";
		}

		//$borderColor = "#333333";
	}
	if(!empty($is_email)) {
		if ($email_color == 'transparent')
		{
			$foreColor = "#000000";
		}
		else {
			$foreColor = "#FFFFFF";
		}
	}

	if (empty($fontsize))
	{
		$fontsize = 13;

		if ($isPrint && $paper == 'A5')
		{
			$fontsize = 11;
		}
	}

	$halfBorder = 0.5;
	$fullBorder = 1;

	$h1 = $fontsize * 2.25;
	$h2 = $fontsize * 1.5;
	$h3 = $fontsize * 1.125;
	$h4 = $fontsize * 0.875;
	$h5 = $fontsize * 0.75;
	$finaltotal = $fontsize +3;
	$fnt11 = $h4;

	$headColor = (empty($is_email) ? $bgColor : $email_color);
	//print_R($headColor);
//print_R(count(explode(",",$export_type)) );
	//if(count(explode(",",$export_type)) > 1) {

	//print_R($headColor);
	//if(!empty($headColor)) {
		//$headColor = $colorr;
	//}
	//print_R($headColor);
?>
<style>
 /** {
   all: initial;
  }*/
html, body, page, pre {
	font-family: <?php echo !empty($fontname) ? ($fontname . ",") : ""; ?>Arial,Helvetica,sans-serif;
	font-size: <?php echo $fontsize; ?>px !important;
	line-height: 1.2;
	color: #222;
}
@media print {
	#Header, #Footer {
		display: none !important;
	}
}
page {
	width: 100%;
	display: inline-block;
	height: auto;
}
.gray {
	color: gray;
}
h1, .h1 { font-size: <?php echo $h1; ?>px;}
h2, .h2 { font-size: <?php echo $h2; ?>px;}
h3, .h3 { font-size: <?php echo $h3; ?>px;}
h4, .h4 { font-size: <?php echo $h4; ?>px;}
.finaltotal{
	font-size: <?php echo $finaltotal; ?>px;
}
.test{
	width: 100%;
	<?php if(empty($isPrint)){?>
	border-bottom: none !important;
	<?php } ?>
	border-left: none !important;
	border-right: none !important;
}
table {
	width: 100%;
	font-size: <?php echo $fontsize; ?>px !important;
	border-bottom: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?>;
	<?php if(empty($isvertical) || (!empty($isvertical) && $isvertical == 2)) { ?>
	border-left: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?>;
	<?php } ?>
}
table th, table td {
	vertical-align: middle;
	padding: 5px;
	border-bottom: 0px;
	border-left: 0px;
	<?php if(empty($isvertical) || (!empty($isvertical) && $isvertical == 2)) { ?>	
	border-right: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?>;
	<?php } ?>
	border-top: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?>;
	line-height: 1.2;
}

 table.inv_details th {
	border-bottom: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?>;
	border-top: 0px;
}
table.inv_details td{
	<?php if(!empty($isDiminishPad) && empty($charges)) { ?>
		border-top : none !important;
	<?php } ?>	
	<?php if(empty($isvertical) && empty($isDiminishPad)) { ?>
		border-bottom: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?>;
	<?php } ?>
	border-top: 0px;
	<?php if(empty($isvertical) && !empty($isDiminishPad)) { ?>
		border-top : 0.5px solid grey !important;
		
	<?php } ?>
	vertical-align : top !important;
	
}
table.inv_details tr.childtr td, table.inv_details tr.parenttr td {
	border-bottom: 0px;
}
<?php if(!empty($isvertical) && $isvertical == 2) { ?>
tr.subtot td {
    border-top: 1px solid black !important;
}
tr.charges td {
    border-top: 1px solid black !important;
}
<?php } ?>
<?php if(!empty($isDiminishPad)) { ?>
table.inv_details th {
	padding:2px !Important;
}
tr.subtot td {
    border-top: 1px solid black !important;
}
tr.charges td {
	    border-top: 1px solid black !important;
}
<?php } ?>	
<?php if(!empty($headColor)) { ?>
table.inv_details th  {
	/*border-top: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?>;*/
}
<?php } ?>
<?php if(($headColor == 'transparent') && $isPrint) { ?>
table.inv_details th  {
	border-top: none;
}
<?php } ?>
table th {
	font-weight: bold;
}
table.noborder {
	border-bottom: 0px;
	border-left: 0px;
}
table.noborder th, table.noborder td {
	border-right: 0px;
	border-top: 0px !important;
	border-bottom: 0px;
}
.nbh, table.nbh, table.nbh th, table.nbh td, table.nbh2 th, table.nbh2 td {
	border-bottom: 0px;
	border-top: 0px;
}
.nbv, table.nbv, table.nbv th, table.nbv td {
	border-left: 0px;
	border-right: 0px;
}
.nb, table.nb, table.nb th, table.nb td {
	border-top: 0px;
	border-right: 0px;
	border-bottom: 0px;
	border-left: 0px;
}
.taxbob td{
		border-top: none;
	}
table.nopadding th, table.nopadding td {
	padding: 0px;
}
table.auto {
	width: auto;
}
table.vat th, table.vat td {
	vertical-align: top;
	border-color: #000000;
}
table.vam th, table.vam td, thead.vam th, tr.vam td {
	vertical-align: middle;
}
table.wpw td {
	white-space: pre-wrap;
}
/*
h1 { font-size: 2.25em;}
h2 { font-size: 1.5em;}
h3 { font-size: 1.125em;}
h4 { font-size: 0.875em;}
*/
.hr {
	color: <?php echo $borderColor; ?>;
	border-color: <?php echo $borderColor; ?>;
	margin: 0px;
	padding: 0px;
	line-height: <?php echo $halfBorder; ?>px;
}
tr.hrtag td {
	padding: 0px;
}
.dib {
	display: inline-block;
}
.nm {
	margin: 0px;
}
.nmt {
	margin-top: 0px;
}
.nmb {
	margin-bottom: 0px;
}
.nmr {
	margin-right: 0px;
}
.nml {
	margin-left: 0px;
}
.al {
	text-align: left;
}
.ar {
	text-align: right;
}
.ac {
	text-align: center;
}
.nb {
	border: 0px;
}
.nbt, table.nbt, table.nbt th, table.nbt td {
	border-top: 0px;
}
.nbr, table tr td.nbr {
	border-right: 0px;
}
.nbb {
	border-bottom: 0px;
}
.nbl {
	border-left: 0px;
}
.np {
	padding: 0px;
}
.npl {
	padding-left: 0px;
}
.npt {
	padding-top: 0px;
}
.npr {
	padding-right: 0px;
}
.npb {
	padding-bottom: 0px;
}
.npv {
	padding-left: 0px;
	padding-right: 0px;
}
.nph, table td.nph {
	padding-top: 0px;
	padding-bottom: 0px;
}
.fw {
	width: 100%;
	display: block;
}
.detailTable table tr.odd {
	background: #EAEAEA;
}
.detailTable table tr.even {
	background: #FFFFFF;
}
.vat, table tbody tr td.vat, table.vat tbody tr td {
	vertical-align: top;
	border-color: #000000;
}
.vam, table tbody tr td.vam  {
	vertical-align: middle;
}
.vab, table tbody tr td.vab {
	vertical-align: bottom;
}
.noside {
	float: left;
	clear: both;
}
.fltlt {
	float: left;
}
.fltrt {
	float: right;
}
.clrbth {
	clear: both;
}
.bob {
	border-bottom: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?> !important;
}
.bol {
	border-left: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?> !important;
}
.bor {
	border-right: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?> !important;
}
.bot {
	border-top: <?php echo $halfBorder; ?>px solid <?php echo $borderColor; ?> !important;
}
.bothead {
	border-top: <?php echo $halfBorder; ?>px solid #d4d4d5 !important;
}
.pretxt {
	white-space: pre-wrap;
}
/*
.bol {
	border-left: 1px solid <?php echo $borderColor; ?>;
}
.bob, table.noborder tbody tr td.bob {
	border-bottom: 1px solid <?php echo $borderColor; ?>;
}
.bot {
	border-top: 1px solid <?php echo $borderColor; ?>;
}
*/
.b {
	font-weight: bold;
}
.asterisk {
	color: black;
	font-weight: bold;
}
.imgDiv {
	display: inline-block;
	/*max-height: 90px;*/
	padding: 5px;
	text-align: center;
}
.sign img {
	max-width: 120px;
	width: 120px;
}
.imgDiv img {
	max-width: 120px;
	width: 120px;
	/*height: auto;
	max-height: 80px;*/
	display: inline-block;
}
.fnt-small, table tr td.fnt-small {
	font-size: smaller;
}
.fnt-11, table tr td.fnt-11 {
	font-size: <?php echo $fnt11; ?>px;
	line-height: <?php echo $fontsize; ?>px;
}
.genby, .footerTxt {
	text-align: center;
	font-size: <?php echo $fnt11; ?>px;
	width:100%;
	display: inline-block;
	padding: 10px 0;
}
.watermark {
	text-align: center;
	font-size: <?php echo $fnt11; ?>px;
	width:100%;
	display: inline-block;
	color: gray;
}
.watermark a {
	color: gray;
	text-decoration: none;
}
.headtxt {
	background-color: <?php echo $headColor; ?>;
	color: <?php echo $foreColor; ?>;
	font-weight: bold;
	padding: <?php echo $headColor == "transparent" ? "0px 7px 7px 0px" : "7px"; ?>;
	display: inline-block;
	width:100%;
}
td.headtd {
	background-color: <?php echo $headColor; ?>;
	color: <?php echo $foreColor; ?>;
}
td.headtd, td.headtd2 {
	font-weight: bold;
	padding: <?php echo $headColor == "transparent" ? "0px 7px 7px 0px !important;" : "7px !important;"; ?>;
	width:100%;
	font-size:<?php echo $fontsize * 1.3; ?>px !important;
}
.bgColor {
	color: <?php echo $headColor == "transparent" ? "#000000" : $headColor; ?>;
}
<?php if ($isPrint) { ?>
a.refLink {
	color: #000;
	text-decoration: none;
}
<?php } ?>
.total {
	font-size: <?php echo $fontsize * 1.3; ?>px;
}
/*Only for compact template*/
<?php if(!empty($isDiminishPad)) { ?>
table td {
	padding:<?php echo $tdPadding; ?>px !important;
	
}
table td {
	line-height : 1 !important;
}
<?php } ?>
<?php if(!empty($paper) && $paper == 'A5') { ?>

table td {
	line-height : 1.1 !important;
}
<?php } ?>
table tbody tr.includetax td, table tbody tr.includetax td b {
	font-style: italic;
}
table tr.taxsum td {
	font-weight: bold;
}
<?php
	if (!empty($isCompact))
	{
		echo 'tr.custFields td { font-size: ' . $h4 . 'px;}' . PHP_EOL;
	}
?></style>
