/********************************************************************************************************************************
 * Copyright 2021-2024 MinusOne, Inc.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom
 * the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 ********************************************************************************************************************************/
body {
	font-family: var(--font-default);
	background-color: var(--bg-default);
	color: var(--text-default);
}
/* Basic Needs */
div, form {
	display: flex; 
}
div.table {
	display: inline-table;
	flex-direction: column;
}
a {
	text-decoration: underline;
	color: var(--text-default);
}
.brand-bg a {
	color: var(--text-inverse);
}
input[type='button'] {
	padding: 2px 4px 2px 4px;
}
ul {
	list-style-type:none;
}
.red {
	color: var(--brand-highlight);
}
.border {
	border: 1px solid var(--brand-highlight-dark);
}
img.logo {
	height: 24px;
}

/* Color Palette */
.brand-bg {
	background-color: var(--brand-dark);
	color: var(--text-inverse);
}
.error {
	font-weight: bold;
}
.formError {
	margin: 10px 0 0 40px;
	height: 15px;
}
.red {
	color: var(--brand-highlight);
}
.warn {
	background-color: var(--brand-highlight);
	color: var(--text-inverse);
}
.boom {
	width: 150px;
}
/* View Management */
.hide {
	display: none;
}
a.selected, li.selected {
	font-weight: bold;
}
a.highlight, li.highlight {
	color: var(--brand-highlight);
}

/* Layout helpers */
.wide {
	width: 100%;
}
.view {
	width: 100vw;
}
.tall {
	height: 100%;
}
.main {
	height: 800px;
}
.flex {
	display: flex;
}
.horizontal {
	flex-direction: row;
}
.vertical {
	flex-direction: column;
}
.spread {
	justify-content: space-between;
}
.end {
	justify-content: flex-end;
}
.sidebar {
	min-width: 320px;
	max-width: 320px;
}
.shim {
	width: 15px;
	background-image: linear-gradient(to right, var(--brand-dark), var(--brand-light));
}
.reserved {
	min-width: 50px;
}
.space {
	margin-left: 4px;
}
.doublespace {
	margin-left: 8px;
}
.spaceBoth {
	margin-left: 4px;
	margin-right: 4px;
}
.spaceDown {
	margin-top: 4px;
}
.spaceSection {
	margin-bottom: 6px;
}
.spaceAll {
	margin: 4px;
}
.downCol {
	margin-top: 6px;
}
.midDown {
	margin-top: 8px;
}
.bump {
	margin-left: 20px;
}
.down {
	margin-top: 20px;
}
.spaceUp {
	margin-bottom: 4px;
}
.title {
	margin-top: 20px;
	margin-bottom: 10px;
}
.message {
	margin: 4px 0 0 0;
	font-weight: bold;
	line-height: 14px;
}
.nav {
	margin-left: 20px;
}
.colCenter {
	width: 520px;
}
.colRight {
	flex-direction: column;
}
.colRight .spacer {
	height: 68px;
}

/* Content Formatting */
h1, .h1 {
	font-size: 32px;
	font-family: pt mono, monospace;
	margin: 12px 0 8px 10px;
	flex-direction: column;
}
h2, .h2 {
	font-size: 180%;
	line-height: 24px;
}
h3, .h3 {
	font-size: 140%;
	margin-top: 5px;
	margin-bottom: 5px;
}
h4, .h4 {
	font-size: 120%;
	margin-top: 5px;
	margin-bottom: 5px;
}
li.option {
	margin-top: 5px;
	margin-bottom: 5px;
	padding-left: 10px;
	padding-top: 5px;
	padding-bottom: 5px;
	cursor: pointer;
}
li.entity {
	border: 1px solid var(--brand-dark);
	margin-bottom: 10px;
	cursor: pointer;
}
div.row {
	margin-top: 5px;
	margin-bottom: 5px;
}
div.property {
	width: 60px;
	justify-content: end;
}
div.system {
	width: 120px;
	justify-content: end;
}
.htab {
	padding: 5px 20px 5px 0px;
}
.control {
	margin-top: 5px;
	margin-bottom: 5px;
}
.control .op {
	width: 80px;
	margin-left: 10px;
}
.underline {
	border-bottom: 1px solid var(--brand-highlight-dark);
}
.bold {
	font-weight: bold;
}
.underred {
	border-bottom: 1px solid var(--brand-highlight);
}
.m1blue .underline {
	border-bottom: 1px solid var(--border-light);
}

/* Forms */
.field {
	margin: 10px 0 0 0;
	flex-direction: row;
}
.field .name {
	width: 150px;
	margin: 0 10px 0 0;
	justify-content: flex-end;
}
form .field .value {
	width: 250px;
}
.field .value {
	width: 350px;
	flex-direction: row;
}
.value input[type='checkbox'] {
	margin: 0 10px 6px 0;
}
form.float input[type="text"], form.float input[type="password"], 
form.float-left input[type="text"], form.float-left input[type="password"] {
	width: 100px;
}

.formset form {
	margin: 0 0 0 20px;
}

div.sidebar input[type='button'],div.sidebar input[type='submit'] {
	width: 60px;
}
div.query {
	flex-direction: column;
	padding: 6px;
	border: 1px solid var(--border-light);
}
div.query :not(:last-child) {
	margin-bottom: 6px;
}
div.query input[name='min'], div.query input[name='max'], div.query input[name='gap'] {
	width: 50px;
}
div.query textarea {
	width: 100%;
}
div.group {
	flex-direction: column;
	margin-top: 5px;
}
div.divide {
	border-bottom: 1px solid var(--brand-highlight);
}
a.button {
	margin-right: 2px;
	color: var(--brand-dark);
}
select.property {
	margin-top: 10px;
}
div.op {
	margin-top: 10px;
	border-bottom: 1px solid var(--brand-dark);
}
div[data-op] {
	background-color: white;
	color: var(--brand-dark);
}
div[data-op] a {
	color: var(--brand-dark);
}
div[data-op='and'] {
	background-color: var(--brand-dark);
	color: var(--text-inverse);
}

div.separator {
	min-height: 20px;
	background-color: var(--brand-dark);
	margin-top: 4px;
}

div.constraints {
	flex-direction: column;
	margin-bottom: 4px;
}
div.constraint select {
	width: 100%;
}
div.constraint div.range div {
	margin: 4px;
}

div.range {
	min-height: 20px;
	margin-top: 4px;
}

div.range input.wide {
	width: 97%;
}

.results {
	margin-left: 20px;
	margin-top: 6px;
}
.results table {
	table-layout: fixed;
}
.results table tr {
	max-height: 100px;
}
.results td {
	width: 180px;
	min-width: 180px;
	max-width: 180px;
	max-height: 100px;
	padding: 8px;
	overflow: hidden;
}
.results tbody td {
	text-overflow: ellipsis;
}
.results td div.wrapper {
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
}
.results table thead td {
	font-weight: bold;
	background-color: var(--brand-highlight-dark);
	color: var(--text-inverse);
	border: 1px dotted white;
	word-wrap: anywhere;
}
.results table tbody td {
	background-color: white;
	color: var(--text-default);
	border: 1px solid var(--brand-dark);
	white-space: break-spaces;
}

.meta h4.count {
	min-width: 250px;
}

.meta .reserved {
	margin-left: 10px;
}

div.thead {
	flex-direction: column;
}
div.tbody {
	flex-direction: column;
}
div.tr {
	flex-direction: row;
}
div.td {
	width: 180px;
	min-width: 180px;
	max-width: 180px;
	max-height: 100px;
	padding: 8px;
	overflow: hidden;
	text-overflow: ellipsis;
}
div.thead div.td {
	font-weight: bold;
	background-color: var(--brand-highlight-dark);
	border: 1px dotted white;
	white-space: nowrap;
}
div.tbody div.td {
	background-color: white;
	color: var(--brand-dark);
	border: 1px solid var(--brand-dark);
	white-space: break-spaces;
}
