/*
 * ------------------
 * Styles for tables
 * ------------------
 */

table {
	position: relative;
	border-collapse: separate;
	border-spacing: 0;
}

table:not(:last-child) {
	margin-bottom: 10px;
}

table th, table td {
	text-align: left;
	line-height: 1.6em;
	padding: calc( 10px - 0.3em ) 5px calc( 10px - 0.3em ) 5px;
	border-top: none !important; /*Override bootstrap*/
}

table th:first-child, table td:first-child {
	padding-left: 10px;
}

table th:last-child, table td:last-child {
	padding-right: 10px;
}

table tr.active > *:first-child {
	border-left: 1px solid var( --color-lime );
}

table tr.active th, table tr.active td {
	border-top: 1px solid var( --color-lime ) !important;
	border-bottom: 1px solid var( --color-lime );
	position: relative;
}

table tr.active > *:last-child {
	border-right: 1px solid var( --color-lime );
}

table tr.active th::before, table tr.active td::before {
	display: block;
    content: "";
    position: absolute;
    top:  0;
    left: 0;
    height: 100%;
    width:  100%;
    background-color: var( --color-lime );
    opacity: 0.25;
}

/*
 * --------------
 * Table bordered
 * --------------
 */

table.table-bordered {
	border: 1px solid var( --color-pearlgray );
	border-radius: 2px;
}

.table-bordered th,
.table-bordered td {
	border: none !important; /*Override bootstrap*/
}

table.table-bordered tr:not(:last-child) td,
table.table-bordered tr:not(:last-child) th {
	border-bottom: 1px dashed var( --color-pearlgray-light ) !important;
}

table.table-bordered tr td:not(:last-child),
table.table-bordered tr th:not(:last-child) {
	border-right: 1px solid var( --color-pearlgray ) !important;
}

table.table-bordered thead tr:last-child td,
table.table-bordered thead tr:last-child th {
	border-bottom: 1px solid var( --color-pearlgray ) !important;
}

table.table-bordered tfoot tr:first-child td,
table.table-bordered tfoot tr:first-child th {
	border-top: 1px solid var( --color-pearlgray ) !important;
}

table.table-bordered thead th {
	background-color: var( --color-pearlgray-light );
}

table.table-bordered thead td {
	background-color: var( --color-white );
}

table.table-bordered tbody th {
	background-color: var( --color-pearlwhite );
}

table.table-bordered tbody td {
	background-color: var( --color-white );
}

table.table-bordered tfoot th {
	background-color: var( --color-pearlwhite );
}

table.table-bordered tfoot td {
	background-color: var( --color-white );
}

/*
 * -------------
 * Table striped
 * -------------
 */

/* outer borders */

table.table-striped tr td:first-child, table.table-striped tr th:first-child {
	border-left: 1px solid var( --color-panthablack );
}

table.table-striped > *:first-child tr:first-child td, table.table-striped > *:first-child tr:first-child th {
	border-top: 1px solid var( --color-panthablack ) !important;
}

table.table-striped > *:last-child tr:last-child td, table.table-striped > *:last-child tr:last-child th {
	border-bottom: 1px solid var( --color-panthablack );
}

table.table-striped tr td:last-child, table.table-striped thead tr th:last-child {
	border-right: 1px solid var( --color-panthablack );
}

/* thead  */

table.table-striped thead tr th, table.table-striped thead tr td {
    background-color: var( --color-panthagray );
	color: var( --color-white );
}

table.table-striped thead tr:first-child td:first-child, table.table-striped thead tr:first-child th:first-child {
	border-top-left-radius: 2px;
}

table.table-striped thead tr:first-child td:last-child, table.table-striped thead tr:first-child th:last-child {
	border-top-right-radius: 2px;
}

/* thead outer borders  */

table.table-striped thead tr:first-child td, table.table-striped thead tr:first-child th {
	border-bottom: 1px solid var( --color-panthablack );
}

/* thead inner borders  */

table.table-striped thead tr td:not(:last-child), table.table-striped thead tr th:not(:last-child) {
	border-right: 1px solid var( --color-panthablack );
}

table.table-striped thead tr:not(:last-child) td, table.table-striped thead tr:not(:last-child) th {
	border-bottom: 1px solid var( --color-panthablack );
}

/* tbody  */

table.table-striped tbody tr:nth-child(odd) th, table.table-striped tbody tr:nth-child(odd) td {
	background-color: var( --color-white );
}

table.table-striped tbody tr:nth-child(even) th, table.table-striped tbody tr:nth-child(even) td {
	background-color: var( --color-pearlwhite );
}

table.table-striped:not(:has(thead)) tbody tr:last-child td:first-child, table.table-striped tbody tr:last-child th:first-child {
	border-top-left-radius: 2px;
}

table.table-striped:not(:has(thead)) tbody tr:last-child td:last-child, table.table-striped tbody tr:last-child th:last-child {
	border-top-right-radius: 2px;
}

table.table-striped:not(:has(tfoot)) tbody tr:last-child td:first-child, table.table-striped tbody tr:last-child th:first-child {
	border-bottom-left-radius: 2px;
}

table.table-striped:not(:has(tfoot)) tbody tr:last-child td:last-child, table.table-striped tbody tr:last-child th:last-child {
	border-bottom-right-radius: 2px;
}

/* tbody inner borders  */

table.table-striped tbody tr td:not(:last-child), table.table-striped tbody tr th:not(:last-child) {
	border-right: 1px solid var( --color-pearlgray-light );
}

table.table-striped tbody tr:not(:last-child) td, table.table-striped tbody tr:not(:last-child) th {
	border-bottom: 1px solid var( --color-pearlgray-light );
}

/* tfoot  */

table.table-striped tfoot tr th, table.table-striped tfoot tr td {
    background-color: var( --color-panthagray );
	color: var( --color-white );
}

table.table-striped tfoot tr:last-child td:first-child, table.table-striped tfoot tr:last-child th:first-child {
	border-bottom-left-radius: 2px;
}

table.table-striped tfoot tr:last-child td:last-child, table.table-striped tfoot tr:last-child th:last-child {
	border-bottom-right-radius: 2px;
}

/* tfoot outer borders  */

table.table-striped tfoot tr:first-child td, table.table-striped tfoot tr:first-child th {
	border-top: 1px solid var( --color-panthablack ) !important;
}

/* tfoot inner borders  */

table.table-striped tfoot tr td:not(:last-child), table.table-striped tfoot tr th:not(:last-child) {
	border-right: 1px solid var( --color-panthablack );
}

table.table-striped tfoot tr:not(:last-child) td, table.table-striped tfoot tr:not(:last-child) th {
	border-bottom: 1px solid var( --color-panthablack );
}



/*
 * ------------
 * Table dashed
 * ------------
 */

table.table-dashed tr td:not(:first-child), table.table-dashed tr th:not(:first-child) {
	border-left: 1px dashed var( --color-pearlgray-light );
}

table.table-dashed thead tr:first-child td, table.table-dashed thead tr:first-child th {
	border-bottom: 1px dashed var( --color-pearlgray-light );
}

table.table-dashed tbody tr:not(:last-child) td, table.table-dashed tbody tr:not(:last-child) th {
	border-bottom: 1px dashed var( --color-pearlgray-light );
}

table.table-dashed tfoot tr:first-child td, table.table-dashed tfoot tr:first-child th {
	border-top: 1px dashed var( --color-pearlgray-light ) !important;
}

table.table-dashed tfoot tr:not(:last-child) td, table.table-dashed tfoot tr:not(:last-child) th {
	border-bottom: 1px dashed var( --color-pearlgray-light );
}

/*
 * -----------
 * Table plain
 * -----------
 */

table.table-plain {
	margin-bottom: 20px;
}

table.table-plain {
	border: 1px solid var( --color-pearlgray-light );
	border-radius: 2px;
}

table.table-plain tr th {
    background-color: var( --color-pearlwhite );
}

table.table-plain thead tr {
    background-color: var( --color-panthagray );
    color: var( --color-pearlwhite );
}

table.table-plain tfoot tr {
    background-color: var( --color-pearlgray-light );
}

table.left-aligned tr th:last-child, table.left-aligned tr td:last-child {
	width: 100%;
}

/*
 * -----------------------------
 * Styles for table-like layouts
 * -----------------------------
 */

.display-table {
	display: table;
}

.display-table-row {
	display: table-row;
}

.display-table-cell {
	display: table-cell;
	vertical-align: middle;
}