/* colors */
:root {
	--content: #333;
	--link: #1976D2;
	--brand-light: #BBDEFB;
	--brand: #1976D2;
	--brand-dark: #286eb5;
	--info-light: #BBDEFB;
	--info: #2196F3;
	--info-dark: #2f6b9c;
	--success-light: #C8E6C9;
	--success: #4c9c50;
	--success-dark: #49834b;
	--warning-light: #FFECB3;
	--warning: #d3a51d;
	--warning-dark: #8e7426;
	--danger-light: #FFCDD2;
	--danger: #e11004;
	--danger-dark: #c51d14;
	--grey0: #333;
	--grey1: #666;
	--grey2: #888;
	--grey3: #aaa;
	--grey4: #ccc;
	--grey5: #ddd;
	--grey6: #eee;
	--grey7: #f4f4f4;
	--grey8: #f9f9f9;
	--text-dark: #333;
	--text-light: #999;
	--button-bg: #e4e4e4;
	--button-color: #333;
	--font-family: helvetica, arial, sans-serif;
	--body-bg: #f4f4f4;
}

/* layout */
body {
	font-family: var(--font-family), sans-serif;
	font-size: 16px;
	line-height: 1.6;
	color: var(--text-dark);
	background-color: var(--grey7);
	margin: 0;
	padding: 0;
}

body.noscroll { overflow: hidden; }

#header {
	background: var(--brand);
	color: #fff;
	padding: 10px;
	text-align: center;
	display: flex;
	flex-direction: row;
	align-items: center;
}

#header-left {
	margin-left: 10px;
	display: inline-flex;
	flex-grow: 1;
	justify-content: left;
}

#header-middle {
	display: inline-flex;
	flex-grow: 0;
	flex-shrink: 1;
	justify-content: flex-start;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#header-right {
	justify-content: right;
	margin-right: 5px;
	display: inline-flex;
	flex-grow: 1;
}

#header i {
	font-size: 1em;
	line-height: 1.6;
	padding: 0 5px;
	margin: 0 2px;
	cursor: pointer;
	opacity: 0.8;
}

#header img {
	height: 27px;
	width: 27px;
	margin: -6px 5px;
	border-radius: 50%;
	border: 1px solid var(--grey3);
	vertical-align: middle;
	filter: grayscale(70%);
}

#header i:hover {
	background: rgba(255, 255, 255, 0.1);
	opacity: 1;
}

#header img:hover {
	filter: grayscale(0%);
}

#header input.header-input {
	background: var(--brand-light);
	width: 90px;
	margin: 0 5px;
	border: 0;
	min-height: unset;
}

#header input.header-input::placeholder {
	color: var(--brand);
	opacity: 0.9;
}

#header input.header-input:focus {
	background: white;
	/*width: 150px; - causes middle column to jump*/
}

#header input.header-input:focus::placeholder {
	opacity: 0; /* Makes the placeholder completely transparent */
}

#header a {
	color: white;
}

#header-brand a {
	display: flex;
	align-items: center;
	font-size: 1.2em;
	font-weight: 600;
	cursor: pointer;
}

#header-brand a {
	text-decoration: none;
	color: inherit;
}

#header-brand img {
	height: 30px;
	margin: 0 15px 0 5px;
}

#header-right .header-link {
	display: inline-block;
	padding: 2px 10px;
	cursor: pointer;
	color: #fff;
	text-decoration: none;
}

#header-right .header-link:hover {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 5px;
}

#header-right .header-link.button-link {
	background: var(--success);
	border-radius: 5px;
	margin: 0 5px;
}

#header-right .header-link.button-link:hover {
	background: var(--success-dark);
}

#content {
	margin: 20px;
	min-height: calc(100vh - 133px);
}

#app-content {
	background: #f9f9f9;
	padding: 20px;
	margin: 10px;
	overflow: auto;
	min-height: 50vh;
}

#footer {
	background: var(--grey4);
	font-size: 0.8em;
	color: var(--text-dark);
	padding: 10px 20px;
	box-sizing: border-box;
}

#footer a.footer-link {
	margin-left: 10px;
}

#footer a {
	color: var(--grey0);
	text-decoration: none;
}

#footer a:hover {
	text-decoration: underline;
	color: var(--brand);
}

/* buttons */

button, .button, input[type=submit] {
	cursor: pointer;
	text-decoration: none;
	font-size: 15px;
	display: inline-block;
	text-align: center;
	border-radius: 5px;
	padding: 5px 10px;
	border: 1px solid var(--grey4);
	background: var(--button-bg);
	color: var(--button-color);
	min-height: unset;
}
button.small, .button.small {
	font-size: 0.85em;
	line-height: 1.2;
	padding: 3px 6px;
	border-radius: 3px;
}
a.button { padding: 6px 10px; line-height: 1; }
a.button.small { padding: 4px 6px; line-height: 1; }

button:hover, .button:hover {
	background: var(--grey4);
	border-color: var(--grey4);
	text-decoration: none;
}
button.default, .button.default {
	background: var(--button-bg);
	color: var(--button-color);
}
button.default:hover, .button.default:hover {
	background: var(--grey4);
	border-color: var(--grey4);
}
button.primary, .button.primary {
	background: var(--brand);
	color: #fff;
	border-color: var(--brand-dark);
}
button.primary:hover, .button.primary:hover {
	background: var(--brand-dark);
	color: #fff;
	border-color: var(--text-dark);
}
button.danger, .button.danger {
	background: var(--danger);
	color: #fff;
	border-color: var(--danger-dark);
}
.button.milddanger {
	color: var(--danger-dark);
	border-color: var(--danger);
}
button.danger:hover, .button.danger:hover {
	background: var(--danger-dark);
	color: #fff;
	border-color: var(--text-dark);
}
.button.milddanger:hover {
	color: var(--danger);
	border-color: var(--danger-dark);
	background: var(--danger-light);
}
button.success, .button.success {
	background: var(--success);
	color: #fff;
	border-color: var(--success-dark);
}
button.success:hover, .button.success:hover {
	background: var(--success-dark);
	color: #fff;
	border-color: var(--text-dark);
}
button.disabled, .button.disabled {
	background: var(--grey3);
	color: var(--grey4);
	cursor: not-allowed;
}
button.icon-button i, .button.icon-button i {
	margin-right: 5px;
	font-size: 0.9em;
}

/* links */
a {
	color: var(--link);
	text-decoration: none;
	cursor: pointer;
}
a:hover {
	text-decoration: underline;
}

/* inputs */
iframe { border: 0; }
input, select, textarea {
	padding: 5px 10px;
	border: 1px solid var(--grey4);
	border-radius: 5px;
	background: white;
	font-size: 15px; /* MUST be in px for richinput etc */
	font-family: var(--font-family), sans-serif;
	color: var(--text-dark);
	box-sizing: border-box;
	caret-color: black;
	min-height: 34px;
	position: relative;
}
::placeholder {
	color: var(--grey3);
	opacity: 1; /* Firefox */
}
input[type="checkbox"], input[type="radio"] {
	border: 0;
	width: auto;
	vertical-align: middle;
	min-height: unset;
}
input[type="radio"] {
	margin: 0 5px 0 0;
}
input[type="date"] {
	max-width: 150px;
}
input[type="time"] {
	max-width: 130px;
}
input[type="file"] {
	border: 0;
	background: transparent;
}
input:focus, select:focus, textarea:focus {
	border-color: var(--brand);
	outline: none;
}
input.error, select.error, textarea.error, input.danger, select.danger, textarea.danger {
	border-color: var(--danger);
	background: var(--danger-light);
}
input[type=checkbox].error, input[type=radio].error, input[type=checkbox].danger, input[type=radio].danger {
	outline: 2px solid var(--danger);
}
input[readonly] {
	background: var(--grey8);
}
select option {
	color: var(--text-dark);
}
select:has(option[value=""]:checked) {
	color: var(--grey3);
}
textarea {
	line-height: 1.6em;
	outline: none;
}
input.select2-search__field { min-height: unset; line-height: 1.2em; }
.select2, .select2-results {
	font-size: 15px;
	line-height: unset !important;
}
.select2.select2-container {
	width: 100% !important; /*causes scrollbars on body*/
	max-width: 100% !important;
}
.select2 .select2-selection {
	border: 1px solid var(--grey4);
	min-height: 34px;
}
.select2 .select2-selection--single {
	padding: 2px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
	top: 4px;
}
.select2-results__option--selectable {
	min-height: 1.4em;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
	background-color: var(--brand);
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: var(--brand);
}
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
	border-color: var(--brand);
}
.select2 textarea {
	min-width: unset !important;
	min-height: 1.6em !important;
}
.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove {
	background: var(--grey7) !important;
	border-radius: 0 !important;
	line-height: 1.6em;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
	background: var(--grey7);
	max-width: 80%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove { border-right:0; font-size:0.85em; color:var(--grey3); background: transparent !important; }
.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove:hover { color:var(--danger); }
.select2-results__option {
	padding: 3px 6px;
}
.select2-container--fit-content {
	width: fit-content;
}
.select2-container--fit-content .select2-results>.select2-results__options {
	overflow-x: hidden;
}
.select2-container--fit-content .select2-results__option {
	white-space: nowrap;
}
.select2-hidden-accessible { /* default is absolute and that causes scrollbars on the screen - fix from https://github.com/select2/select2/issues/6168#issuecomment-1362759588 */
	position: fixed !important;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, button:focus-visible, tr:focus-visible {
	outline: none;
}
textarea.big-textarea { width: 100%; min-width: 100%; max-width: 100%; min-height: 4em; }

.fake-input, .field-readonly {
	display: inline-block;
	padding: 5px 10px;
	border: 1px solid var(--grey4);
	border-radius: 5px;
	background: white;
	font-size: 15px;
	font-family: var(--font-family), sans-serif;
	color: var(--text-dark);
	box-sizing: border-box;
	min-height: 34px;
	width: 100%;
}
.field-readonly {
	background: var(--grey8);
}
.pill {
	display: inline;
	padding: 3px 7px;
	line-height: 1;
	border-radius: 3px;
	background: var(--grey7);
	color: var(--text-dark);
	border: 1px solid var(--grey4);
	font-size: 0.85em;
	margin-right: 5px;
	white-space: nowrap;
}

pre {
	background: var(--grey8);
	padding: 10px;
	border-radius: 5px;
	overflow: auto;
	border: 1px solid var(--grey4);
	font-size: 14px;
	font-family: monospace;
}

/* fancy checkboxes */
/* expects label.fancy-check ( input[type=checkbox] , i.unchecked , i.checked ) */
label { user-select: none; }
input.fancy-check { display: none; }
label.fancy-check i { cursor: pointer; width: 1.25em; text-align: left; }
label.fancy-check:has(input[type=checkbox]) { opacity: 0.8; }
label.fancy-check:has(input[type=checkbox]:checked) { opacity: 1; }
label.fancy-check input[type=checkbox], label.fancy-check .checked { display: none; }
label.fancy-check input[type=checkbox]:checked ~ .checked { display: inline-block; }
label.fancy-check input[type=checkbox]:checked ~ .unchecked { display: none; }
label.fancy-check i.unchecked { color: var(--grey3); }
label.fancy-check i.checked { color: var(--brand); }
label.fancy-check i.danger { color: var(--danger); }
label.fancy-check i.success { color: var(--success); }
label.fancy-check i.warning { color: var(--warning); }
label.fancy-check i.info { color: var(--info); }

/* hr */
hr {
	border: 0;
	border-top: 1px solid var(--grey4);
}

/* tables */
table {
	width: 100%;
	border-collapse: collapse;
}
table th, table td {
	border: 1px solid var(--grey4);
	padding: 5px;
}
table th {
	background: var(--grey7);
}

table.collapsed th, table.collapsed td {
	border: 0;
	padding: 0;
}

@media screen and (max-width: 767px) {
	table.responsive td {
		display: block;
	}
	table.responsive tr:last-child {
		border-bottom: 5px solid transparent;
	}
	table.responsive tr td[data-label]:before {
		content: attr(data-label);
		float: left;
		font-weight: bold;
	}
}

.richinput-token-mention {
	background: #def;
}

/* helpers */

.muted {
	opacity: 0.7;
}
.hidden {
	display: none;
}
.float-left {
	float: left;
}
.float-right {
	float: right;
}
.text-left {
	text-align: left;
}
.text-right {
	text-align: right;
}
.text-center {
	text-align: center;
}
.text-justify {
	text-align: justify;
}
.text-uppercase {
	text-transform: uppercase;
}
.text-lowercase {
	text-transform: lowercase;
}
.text-small {
	font-size: 0.85em;
}
.text-large {
	font-size: 1.2em;
}
.text-bold {
	font-weight: bold;
}
.text-italic {
	font-style: italic;
}
.text-underline {
	text-decoration: underline;
}
.text-line-through {
	text-decoration: line-through;
}
.text-light {
	color: var(--text-light);
}
.text-nowrap {
	white-space: nowrap;
}
.text-divider {
	display: flex;
	align-items: center;
	flex-basis: 100%;
	margin: 0.5em 0;
}
.text-divider:before, .text-divider:after {
	content: "";
	flex-grow: 1;
	background: var(--grey4);
	height: 1px;
	margin: 0 1em;
}
.text-danger {
	color: var(--danger);
}
.text-success {
	color: var(--success);
}
.text-warning {
	color: var(--warning);
}
.text-info {
	color: var(--info);
}
.text-muted {
	color: var(--grey3);
}
.text-muted2 {
	color: var(--grey2);
}
.text-h3 {
	font-size: 1.3em;
	font-weight: bold;
}
a.danger {
	color: var(--danger);
}
a.milddanger {
	color: var(--danger-light);
}
a.success {
	color: var(--success);
}
a.warning {
	color: var(--warning);
}
a.info {
	color: var(--info);
}
a.muted {
	color: var(--grey3);
}
a.disabled {
	color: var(--grey3);
	pointer-events: none;
}
a.danger:hover {
	color: var(--danger-dark);
}
a.milddanger:hover {
	color: var(--danger);
}
a.success:hover {
	color: var(--success-dark);
}
a.warning:hover {
	color: var(--warning-dark);
}
a.info:hover {
	color: var(--info-dark);
}
a.muted:hover {
	color: var(--grey3);
}
a.disabled:hover {
	color: var(--grey3);
}
.icon-large {
	width: 1.5em; font-size: 1.5em; color: #888; text-align: center; border: 1px solid #ddd; vertical-align: middle; display: inline-block; height:1.5em; line-height: 1.3em !important;
}
.text-badge {
	box-sizing: border-box;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 500px;
	vertical-align: middle;
	background: var(--brand);
	color: #fff;
	font-size: 12px;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	line-height: 0;
	margin-top: -1px;
}
.mobile-only {
	display: none;
}
@media (max-width: 800px) {
	.not-mobile { display: none; }
	.mobile-only { display: initial; }
}

/* alerts */

.alert { padding: 0.5em 1em; margin-bottom: 1em; border: 1px solid var(--grey4); background: var(--grey7); border-radius: 5px; }

.alert.error { color: var(--danger-dark); background: var(--danger-light); border-color: var(--danger); }

.alert.success { color: var(--success-dark); background: var(--success-light); border-color: var(--success); }

.alert.warning { color: var(--warning-dark); background: var(--warning-light); border-color: var(--warning); }

.alert.info { color: var(--info-dark); background: var(--info-light); border-color: var(--info); }

@keyframes fadeIn {
	from { opacity: 0.3; }
}
.preview { opacity: 0.5; animation: fadeIn 800ms infinite alternate; }

.content-disabled {
	position: relative;
	pointer-events: none;
	user-select: none;
}
.content-disabled:before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(240, 240, 240, 0.5);
	z-index: 1000;
	pointer-events: none;
	user-select: none;
}

/* nav trees */

#tree-menu {
	position: fixed;
	top: 48px;
	left: 0;
	width: 400px;
	max-width: 80vw;
	height: calc(100vh - 48px);
	background: var(--grey7);
	border: 1px solid var(--grey4);
	overflow-y: auto;
	overflow-x: hidden;
	z-index: 2000;
	display: none;
}

#tree-menu .current {
	background: var(--link);
	color: white;
}

#tree-menu .tree-node {
	padding: 5px 10px 5px 20px;
	cursor: pointer;
}

#tree-menu .tree-node.tree-home[data-type=account] {
	color: var(--text-dark);
	font-weight: bold;
	text-align: center;
	border: 1px solid var(--grey4);
	background: var(--grey8);
}

#tree-menu .tree-node[data-type=space] {
}

#tree-menu .tree-node.current {
	background: var(--link);
	color: white;
}
#tree-menu .tree-node.tree-home[data-type=account].current {
	background: var(--brand-light);
}

#tree-menu .tree-footer {
	padding: 5px 10px 25px 20px;
	text-align: center;
	font-size: 0.85em;
}

#tree-menu .tree-node.tree-result {
	border: 1px solid var(--grey4);
	border-top: 0;
}

#tree-menu .tree-node.tree-result .title {

}

#tree-menu .tree-node.tree-result .footnote {
	font-size: 0.85em;
	opacity: 0.5;
}

/* flexbox helpers */
.flex-rows { display: flex; flex-direction: column; height: 100%; }
.flex-cols { display: flex; flex-direction: row; width: 100%; }
.flex-rows>div { flex: 0 0 auto; }
.flex-cols>div { flex: 0 0 auto; }
.flex-rows>div.flex-grow { flex: 1 1 auto; height: 100%; overflow: auto; scrollbar-width: none; }
.flex-cols>div.flex-grow { flex: 1 1 auto; width: 100%; overflow: auto; scrollbar-width: none; }
.box { border: 1px solid var(--grey4); padding: 5px; }

/* width helpers */
.narrow-form { max-width: 800px; }

/* menus */
.gDropMenuOption { white-space: nowrap; }
.gDropMenuOption i { width: 1.3em; margin-right: 5px; }

/* blur fields content - like password */
.blur:not(:focus) {
	color: transparent !important;
	text-shadow: 0 0 5px rgba(0,0,0,0.7);
	text-transform: uppercase;
	text-decoration: underline overline line-through;
	/*-webkit-text-security: disc;*/
	font-family: cursive;
	cursor: pointer;
}

/* separator - hr with text */
.separator { display: flex; align-items: center; text-align: center; }
.separator::before, .separator::after { content: ''; flex: 1; border-bottom: 1px solid var(--grey4); }
.separator:not(:empty)::before { margin-right: .25em; }
.separator:not(:empty)::after { margin-left: .25em; }

/* simple progress bar - used in chunked file uploads */
.simple-progress-bar{position:relative;background:var(--grey8);height:5px;border-radius:10px;overflow:hidden;}
.simple-progress-bar .simple-progress-inner{position:absolute;top:0;left:0;bottom:0;background:var(--brand);transition:all 0.5s ease;border-radius:10px;min-width:5px;}
