:root {
    --surface-background-color: #ffffff;
    --surface-text-color: #404040;

    --error-background-color: #f6a7a3;
    --error-text-color: #000;
    --error-border-color: #8d1310;

    --dangerous-background-color: #c0392b;
    --dangerous-text-color: #ecf0f1;

    --dangerous-background-hover-color: #e74c3c;
    --dangerous-text-hover-color: #ffffff;

    --warning-background-color: #f6caa3;
    --warning-text-color: #000;
    --warning-border-color: #8d5010;

    --success-background-color: #a8f1c6;
    --success-text-color: #000;
    --success-border-color: #198343;

    --primary-accent-color: #2980b9;
    --primary-accent-text-color: #ecf0f1;
    --primary-accent-border-color: #3498db;

    --primary-accent-hover-color: #3498db;
    --primary-accent-hover-text-color: #ffffff;
    --primary-accent-hover-border-color: #3498db;

    --primary-accent-separator-color: #1d6595;

    --secondary-accent-color: #f6f6f6;
    --secondary-accent-text-color: #d0d0d0;
    --secondary-accent-hover-color: #e3e3e3;
    --secondary-accent-hover-text-color: #d0d0d0;
    --secondary-accent-disabled-color: #ededed;
    --secondary-accent-disabled-text-color: #aaa;

    --control-border-color: #bdc3c7;
    --control-label-color: #535353;

    --modal-header-text-color: #6a6a6a;
    --modal-header-link-color: #686868;

    --table-border-color: #ecf0f1;
}

html {
    box-sizing: border-box;
}

input, textarea, button {
    font: inherit;
    color: inherit;
}

form {
    text-align: left;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

::-moz-focus-inner {
    border: 0;
}

:focus {
    outline: none;
}

.error {
    margin-bottom: 24px;
    padding: 12px;
    border-left: 3px solid var(--error-border-color);
    border-radius: 3px;

    color: var(--error-text-color);

    background-color: var(--error-background-color);
}

.warning {
    margin-bottom: 24px;
    padding: 12px;
    border-left: 3px solid var(--warning-border-color);
    border-radius: 3px;

    color: var(--warning-text-color);

    background-color: var(--warning-background-color);
}

.success {
    margin-bottom: 24px;
    padding: 12px;
    border-left: 3px solid var(--success-border-color);
    border-radius: 3px;

    color: var(--success-text-color);

    background-color: var(--success-background-color);
}

.spacer {
    flex: 1;
}

.loader {
    position: fixed;
    z-index: 999;
    inset: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: white;

    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk8AEAAFIATgDK/mEAAAAASUVORK5CYII=");
}

.loader-image {
    width: 32px;
}

.loader-image-black {
    fill: black;
}

.textbox {
    display: block;

    width: 100%;
    margin-bottom: 15px;
    padding: 12px 16px 14px;
    border: 1px solid var(--control-border-color);
    border-radius: 3px;

    color: var(--surface-text-color);

    background-color: var(--surface-background-color);

    transition: border 0.3s;
}

.textbox:focus {
    border-color: var(--primary-accent-color);
}

.textbox-compact {
    padding: 6px 8px 7px;
}

.combobox {
    position: relative;
    margin-bottom: 15px;
}

.combobox-substitute {
    color: inherit;
    text-decoration: none;
}

.combobox-substitute::after {
    content: '\f0d7';

    position: absolute;
    top: 13px;
    right: 15px;

    font-family: 'Font Awesome 5 Free', fantasy;
    font-weight: 600;
}

.combobox-substitute .textbox {
    cursor: pointer;
    margin-bottom: 0;
}

.combobox-compact .combobox-substitute .textbox {
    padding: 6px 8px 7px;
}

.combobox-menu {
    z-index: 99;
    display: block;
    width: 100%;
}

.combobox-compact .combobox-menu .menu-item {
    padding: 5px 12px;
}

.modal {
    pointer-events: none;

    position: absolute;
    z-index: 10;
    top: 50%;
    left: 50%;
    transform-origin: left top;
    transform: perspective(1000px) rotateX(10deg) scale(0.9) translate(-50%, -50%);

    display: flex;
    flex-direction: column;

    min-width: 550px;
    max-width: 90%;
    height: auto;
    max-height: 95%;

    opacity: 0.6;
    background-color: var(--surface-background-color);
    filter: grayscale(1);
    box-shadow: 0 11px 15px -7px rgb(0 0 0 / 20%), 0 24px 38px 3px rgb(0 0 0 / 14%), 0 9px 46px 8px rgb(0 0 0 / 12%);

    transition: all 0.3s;
}

.modal:last-child {
    pointer-events: initial;
    transform: scale(1) translate(-50%, -50%);
    opacity: 1;
    filter: grayscale(0);
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 20px;
}

.modal-header > h1 {
    flex: 1;
    margin: 0;
    font-size: 18px;
    color: var(--modal-header-text-color);
}

.modal-header-actions > a {
    margin-right: 10px;
    color: var(--modal-header-link-color);
    text-decoration: none;
}

.modal-header-actions > a:last-child {
    margin-right: 0;
}

.modal-wo-title .modal-header {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
}

.modal-fullscreen {
    width: 95%;
    height: 95%;
}

.modal-content {
    scrollbar-width: thin;
    overflow: auto;
    flex: 1;
    padding: 20px;
}

.modal-content-parent {
    overflow: hidden;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.modal-fullscreen .modal-content {
    width: auto !important;
    height: auto !important;
}

.modal-actions {
    display: flex;
    justify-content: right;
    margin-top: 20px;
}

.modal-content + .modal-actions {
    margin-top: 0;
    padding: 20px;
}

.table-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table {
    display: flex;
    border-collapse: collapse;
    flex-direction: column;

    min-height: 0;
    border: 0;
}

.table-header {
    border-top: 1px solid var(--table-border-color);
    font-weight: 600;
}

.table-body {
    scrollbar-width: thin;
    overflow: auto;
    display: block;
    border-bottom: 1px solid var(--table-border-color);
}

.table-row {
    display: table;
    table-layout: fixed;

    width: 100%;
    border-bottom: 1px solid var(--table-border-color);

    background-color: var(--surface-background-color);

    transition: background-color 0.3s;
}

.table-row:hover {
    background-color: var(--secondary-accent-color);
}

.table-row:last-child {
    border-bottom: none;
}

.table-header .table-row:hover {
    background-color: inherit !important;
}

.table-action {
    display: none;
    margin-right: 10px;
    color: #95a5a6;
}

.table-action:hover {
    color: var(--surface-text-color);
}

.table-action:last-child {
    margin-right: 0;
}

.table-row:hover .table-action {
    display: inline;
}

.table-column {
    overflow: hidden;

    padding: 10px;

    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-compact .table-column {
    padding: 8px;
}

.table-header .table-row .table-column {
    padding: 12px 10px;
}

.table-compact .table-header .table-row .table-column {
    padding: 10px 8px;
}

.table-column-drag {
    width: 48px;
    color: #d0d0d0;
    vertical-align: bottom;
}

.table-column-check {
    width: 64px;
}

.table-column-sortable {
    cursor: pointer;
}

.table-column-sortable::after {
    content: '\f0dc';
    margin-left: 8px;
    font-family: 'Font Awesome 5 Free', fantasy;
    font-weight: 900;
}

.table-column-sorted-asc::after {
    content: '\f0de';

    position: relative;
    top: 5px;

    font-family: 'Font Awesome 5 Free', fantasy;
    font-weight: 900;
}

.table-column-sorted-desc::after {
    content: '\f0dd';

    position: relative;
    top: -2px;

    font-family: 'Font Awesome 5 Free', fantasy;
    font-weight: 900;
}

.table-column-actions {
    overflow: visible;
    display: flex;
    justify-content: flex-end;
}

.table-header .table-row .table-column-actions > a {
    overflow: hidden;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    margin-top: -35px;
    margin-right: 10px;
    border-radius: 50%;

    font-size: 14px;
    color: white;
    text-decoration: none;

    background-color: var(--primary-accent-color);
    box-shadow: 0 3px 5px -1px rgb(0 0 0 / 20%), 0 6px 10px 0 rgb(0 0 0 / 14%), 0 1px 18px 0 rgb(0 0 0 / 12%);

    transition: all 0.3s;
}

.table-header .table-row .table-column-actions > a.table-column-action-dangerous {
    background-color: var(--dangerous-background-color);
}

.table-header .table-row .table-column-actions > a.table-column-action-dangerous:hover {
    background-color: var(--dangerous-background-hover-color);
}

.table-header .table-row .table-column-actions > a:last-child {
    margin-right: 0;
}

.table-header .table-row .table-column-actions > a:hover {
    background-color: var(--primary-accent-hover-color);
}

.table-column-bulk-action {
    transform: translateY(20px);
    visibility: collapse;
    opacity: 0;
}

.table-header .table-row.table-bulk-visible .table-column-bulk-action {
    transform: translateY(0);
    visibility: visible;
    opacity: 1;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: right;
    padding-top: 10px;
}

.pagination-control {
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    margin-right: 10px;
    border-radius: 50%;

    font-size: 18px;
    color: inherit;
    text-decoration: none;

    transition: all 0.3s;
}

.pagination-control.disabled {
    pointer-events: none;
    color: var(--secondary-accent-disabled-text-color);
}

.pagination-control:last-child {
    margin-right: 0;
}

.pagination-control:hover {
    color: inherit;
    background-color: var(--secondary-accent-hover-color);
}

.pagination-control-rows-per-page {
    display: flex;
    align-items: center;
    margin-right: 30px;
}

.pagination-control-rows-per-page label {
    margin-right: 10px;
    white-space: nowrap;
}

.pagination-control-rows-per-page .combobox {
    width: 82px;
    margin-bottom: 0;
}

.pagination-control-page-details {
    margin-right: 30px;
}

.splitter {
    cursor: ew-resize;
    position: absolute;
    z-index: 999;
    background-color: transparent;
}

.tree {
    overflow: hidden;
}

.tree-row {
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    white-space: nowrap;
}

.tree-row.dragover {
    color: white;
    background-color: var(--primary-accent-color);
}

.tree-row.drag-above {
    border-top: 1px solid var(--primary-accent-color);
}

.tree-row.drag-under {
    border-bottom: 1px solid var(--primary-accent-color);
}

.tree-row::after {
    content: '';
    clear: both;
    display: table;
}

.tree-column {
    display: inline-block;
    margin-right: 10px;
    color: inherit;
    text-decoration: none;
}

.tree-column:last-child {
    margin-right: 0;
}

.tree-column > i {
    width: 14px;
    text-align: center;
}

.tree-children {
    clear: both;
    display: none;
    margin-left: 27px;
}

.tree-expanded > .tree-children {
    display: block;
}

.tree-expander {
    visibility: hidden;
}

.tree-expander > i::before {
    content: '\f0fe';
}

.tree-expanded > .tree-expander > i::before {
    content: '\f146';
}

.tree-row-has-children > .tree-expander {
    visibility: visible;
}

.iconview {
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
}

.iconview-entry {
    padding: 10px;
    text-align: center;
}

.iconview-entry-icon {
    width: 100%;
    margin-bottom: 10px;
    font-size: 100px;
    text-align: center;
}

.label {
    display: block;
    margin-top: 10px;
    margin-bottom: 3px;
    color: var(--control-label-color);
}

.label::after {
    content: '';
    clear: both;
    display: table;
}

.checkbox, .radio {
    display: inline;
    margin-bottom: 9px;
    vertical-align: middle;
}

.checkbox-control, .radio-control {
    display: none;
}

.checkbox-substitute, .radio-substitute {
    cursor: pointer;

    position: relative;

    display: inline-block;

    width: 20px;
    height: 20px;
    margin-right: 6px;
    border: 1px solid var(--control-border-color);
    border-radius: 3px;

    vertical-align: middle;

    background-color: var(--surface-background-color);

    transition: background-color 0.3s, border 0.3s;
}

.checkbox-toggle .checkbox-substitute {
    position: relative;

    width: 52px;
    height: 24px;
    border-radius: 24px;

    background-color: var(--control-border-color);

    transition: background 0.3s;
}

.radio-substitute {
    border-radius: 50%;
}

.checkbox-indeterminate .checkbox-control + .checkbox-substitute,
.checkbox-control:checked + .checkbox-substitute,
.radio-control:checked + .radio-substitute {
    border-color: var(--surface-text-color);
    background-color: var(--primary-accent-color);
}

.checkbox-control + .checkbox-substitute::after,
.radio-control + .radio-substitute::after {
    content: '\f00c';

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    font-family: 'Font Awesome 5 Free', fantasy;
    font-size: 12px;
    font-weight: 800;
    color: var(--primary-accent-text-color);

    opacity: 0;

    transition: opacity 0.3s;
}

.checkbox-indeterminate .checkbox-control + .checkbox-substitute::after {
    content: '\f068';
    opacity: 1;
}

.checkbox-toggle .checkbox-control + .checkbox-substitute::after {
    content: '';

    position: absolute;
    left: 15px;

    width: 32px;
    height: 32px;
    border: 1px solid var(--control-border-color);
    border-radius: 50%;

    opacity: 1;
    background-color: var(--surface-background-color);

    transition: left 0.3s, margin 0.3s;
}

.checkbox-control:checked + .checkbox-substitute::after,
.radio-control:checked + .radio-substitute::after {
    opacity: 1;
}

.checkbox-toggle .checkbox-control:checked + .checkbox-substitute::after {
    left: 36px;
    border: 1px solid var(--surface-text-color);
}

.button {
    cursor: pointer;

    margin-right: 5px;
    padding: 8px 20px;
    border: none;
    border-radius: 3px;

    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-align: center;
    text-decoration: none;

    background-color: var(--secondary-accent-color);

    transition: background-color 0.3s;
}

.button:hover {
    background-color: var(--secondary-accent-hover-color);
}

.button:disabled {
    cursor: default !important;
    color: var(--secondary-accent-disabled-text-color) !important;
    background-color: var(--secondary-accent-disabled-color) !important;
}

.button:last-child {
    margin-right: 0;
}

.button > i {
    margin-right: 10px;
}

.button-icon > i {
    margin-right: 0;
}

.button-compact {
    padding: 2px 10px;
}

.button-primary {
    min-width: 150px;
    border-color: var(--primary-accent-border-color);
    color: var(--primary-accent-text-color);
    background-color: var(--primary-accent-color);
}

.button-primary:hover {
    color: var(--primary-accent-hover-text-color);
    background-color: var(--primary-accent-hover-color);
}

.button-danger {
    color: var(--dangerous-text-color);
    background-color: var(--dangerous-background-color);
}

.button-danger:hover {
    color: var(--dangerous-text-hover-color);
    background-color: var(--dangerous-background-hover-color);
}

.button-header {
    float: right;
    margin-left: 10px;
    font-size: 16px;
    vertical-align: middle;
}

.button-combo {
    margin-right: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.button-combo-more {
    border-left: 1px solid var(--primary-accent-separator-color) !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.button-combo-more::after {
    content: '\f0d7';
    font-family: 'Font Awesome 5 Free', fantasy;
    font-weight: 600;
}

.quick-action-button, .context-menu-button {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    border-radius: 50%;

    color: var(--secondary-accent-text-color);
    text-decoration: none;

    transition: all 0.3s;
}

.quick-action-button:hover, .context-menu-button:hover {
    color: inherit;
    background-color: var(--secondary-accent-hover-color);
}

.context-menu {
    position: absolute;
    z-index: 99;

    overflow: hidden;
    display: none;

    border: 1px solid var(--control-border-color);
    border-radius: 5px;

    background-color: var(--surface-background-color);
    box-shadow: 0 2px 1px -1px rgb(0 0 0 / 20%), 0 1px 1px 0 rgb(0 0 0 / 14%), 0 1px 3px 0 rgb(0 0 0 / 12%);
}

.context-menu.visible {
    display: block;
}

.menu-item-wrapper {
    overflow: hidden;
    overflow-y: auto;
    max-height: 300px;
}

.context-menu-grid .menu-item-wrapper {
    display: grid;
}

.context-menu-search-wrapper {
    padding: 3px;
}

.menu-item {
    display: block;

    padding: 10px 24px;
    border-bottom: 1px solid var(--control-border-color);

    color: inherit;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
}

.menu-item:last-child {
    border: 0;
}

.menu-item:hover {
    background-color: var(--secondary-accent-color);
}

.context-menu-compact .menu-item {
    padding: 5px 12px;
}

.menu-item > i {
    display: inline-block;
    width: 24px;
    margin-right: 20px;
}

.menu-item-dangerous:hover {
    color: var(--dangerous-text-hover-color);
    background-color: var(--dangerous-background-hover-color);
}

.modal-wrapper {
    position: fixed;
    z-index: 999;
    inset: 0;

    visibility: hidden;
    opacity: 0;
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk8AEAAFIATgDK/mEAAAAASUVORK5CYII=");

    transition: opacity 0.3s;
}

.modal-wrapper.visible {
    visibility: visible;
    opacity: 1;
}

.tabcontrol-header {
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 10px;
    padding: 0 20px;
}

.tabcontrol-header-link {
    display: block;
    flex: 1;

    padding: 10px;
    border-bottom: 3px solid var(--table-border-color);

    color: #626262;
    text-align: center;
    text-decoration: none;
}

.tabcontrol-body {
    overflow: hidden;
    max-height: 100%;
}

.tabcontrol-page {
    display: none;
}

.tabcontrol-page.active {
    display: block;
}

.tabcontrol-header-link.active {
    border-bottom-color: var(--primary-accent-color);
    color: var(--surface-text-color);
}

.brevis-readmore-wrapper {
    overflow: hidden;
    transition: height 0.3s;
}

.brevis-readmore-toggle {
    position: relative;

    display: block;

    margin-top: -30px;
    padding: 30px 10px 10px;

    text-align: center;

    background: linear-gradient(to bottom, rgb(255 255 255 / 0%) 0%, rgb(255 255 255) 40%);
}

.brevis-readmore.content-visible .brevis-readmore-toggle {
    margin-top: 0;
    padding-top: 0;
    background: none;
}

.draggable {
    cursor: grab;
}

body.dragging {
    cursor: grabbing !important;
}

.dragging-clone {
    pointer-events: none;
    z-index: 9999999;
    opacity: 0.9;
}

.chip {
    display: inline-block;

    padding: 2px 12px;
    border-radius: 15px;

    font-size: 13px;
    color: var(--surface-text-color);

    background-color: var(--secondary-accent-color);
}

.expandable {
    margin-bottom: 24px;
    border: 1px solid var(--control-border-color);
    border-radius: 6px;
}

.expandable-body {
    overflow: hidden;
    display: none;
    padding: 12px;
}

.expandable-expanded .expandable-body {
    display: block;
}

.expandable-header {
    display: flex;
    padding: 12px;
    border-bottom: 0;
}

.expandable-expanded .expandable-header {
    border-bottom: 1px solid var(--control-border-color);
}

.expandable-header-title {
    flex: 1;
}
