:root {
    --color-code-text: #333;
    --color-code-bg: rgba(0,0,0,0.12);

    --color-deep-red: #b00000;

    --font-code: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier,
        monospace;
}

html, body {
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

code {
    color: var(--color-code-text);
    background-color: var(--color-code-bg);
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 2px 5px;
    font-family: var(--font-code);
    font-size: 75%;
    border: none;
    border-radius: 0;
}

.table--hover-highlight tr:hover td:not(.cell--actions):not(.cell__data--readonly) {
    background-color: var(--color-table-row-hover-bg);/
}
.table--hover-highlight tr.tr--stripe-odd:hover td:not(.cell--actions):not(.cell__data--readonly) {
    background-color: var(--color-table-row-odd-hover-bg);
}
.table--hover-highlight tr:hover td.cell__data--readonly {
    background-color: #ccc;
}



.workspace__body--login,
.workspace__body--logout,
.workspace__body--error,
.workspace__body--settings {
    justify-content: center;
    align-items: center;
    overflow-y: scroll;
    gap: var(--default-gap);
}

.workspace__body--admin {
    justify-content: flex-start;
    align-items: center;
    overflow-y: scroll;
    gap: var(--default-gap);
}

.workspace__body--projects,
.workspace__body--views,
.workspace__body--error,
.workspace__body--file-drop-portal,
.workspace__body--edit {
    justify-content: start;
    align-items: center;
    overflow-y: auto;
    overflow-x: auto;
    gap: 10px;
}

.workspace__body--view{
    display: flex;
    justify-content: stretch;
    align-items: stretch;
    gap: 10px;
    height: 100%;
    width: 100%;
    /* background-color: lime;; */
}

/* ----------------------------
 * Projects / Views
 * ----------------------------
 */

 .link-as-button--project,
 .link-as-button--view {
    /* min-width: 130px; */
    width: 100%;
 }

 .encryption-marker {
    margin-left: 10px;
    /* color: var(--color-deep-red); */
    color: var(--color-theme);
 }

/* ----------------------------
 * Scrolling Table (with sticky header)
 * ----------------------------
 */
.container-scrolling-table{
    flex: 1 1 auto;
    height: 100%;
    width: 100%;

    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;

    background-color: var(--bg-clear);
    overflow: auto;
    overflow-y: scroll;
}

.container-scrolling-table table {
    border-collapse: separate;
    border-spacing: 0;
}
.container-scrolling-table td,
.container-scrolling-table th {
    border: none;
}
.container-scrolling-table th{
    position: sticky;
    top: 0;
    z-index: 10;
    /* background-color: var(--color-table-border); */

    border-top: 1px solid var(--color-table-border);
    border-bottom: 1px solid var(--color-table-border);
    border-right : 1px solid var(--color-table-border);
}
 .container-scrolling-table td {
    border-bottom: 1px solid var(--color-table-border);
    border-right: 1px solid var(--color-table-border);
}
.container-scrolling-table th:first-child,
.container-scrolling-table td:first-child {
    border-left: 1px solid var(--color-table-border);
}
.container-scrolling-table-inner{
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
}

/* ----------------------------
 * Misc
 * ----------------------------
 */

#text-search{
    border: 1px solid #aaa;
}
#input-location-depth {
    border: 1px solid #aaa;
}

.button--document-number {
    min-width: 140px;
}

.button--become {
    min-width: 110px;
    border : 1px solid #aaa;
}

#button--help{
    margin-top: 25px;
}

.login-error-text {
    color: red;
    text-align: center;
    justify-content: center;
}

.breadcrumb-bar__body .breadcrumb-fa-icon {
    color: var(--color-theme);
}
.breadcrumb-bar__body .fa-chevron-right {
    filter: opacity(0.5);
}
.cell--null,
.cell--zero {
    filter: opacity(0.2);
}
.cell--negative {
    color: #ff0000;
}
.cell--false {
    color: #770000
}
.cell--true {
    color: #005c00
}
.th--admin {
    background-color: #ffd0aa;
}
.td--admin {
    background-color: #fbeee5;
}
.cell--sum {
    background-color: #d0ffd1;
    /* font-weight: 700; */
}
.cell--error {
    background-color: #ffcbcb;
}
.table--hover-highlight tr:hover td.cell--error {
    background-color: #ffa4a4 !important;
}
.table--hover-highlight tr:hover td.cell--sum {
    background-color: #a1ffa3 !important;
}

.cell__header--actions {
    background-color: #0f4b71;
    color: #f8f8f8;
}
.cell__header--encrypted {
    /* background-color: #d689ff; */
    /* background-color: #efd1ff; */
    /* background-color: ##ffd7f0; */
    background-color: #ffe0ef;
}
.cell--header--readonly {
    background-color: #c6c6c6;
}
.cell__data--readonly {
    background-color: #e9e9e9;
}
/* Needs the td specifier to win over row stripe style */
td.cell--actions  {
    background-color: var(--color-table-header-bg);
}
.cell--actions--container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 5px;
}
.link__row-action {
    display: flex;
    text-decoration: none;
    text-align: center;
    justify-content: center;
    align-items: center;
    /* margin-left: 8px; */
    font-size: 12px;
    color: var(--color-theme);
    border: 0;
    background: #ffffff;
    border-radius: 20px;
    /* padding: 6px 6px; */
    height: 24px;
    width: 24px;
    cursor: pointer;
    /* white-space: nowrap; */

    /* No text selection inside the button/link */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
}
.link__row-action:hover {
    filter: brightness(0.8);
}
.link__row-action--indicator:hover {
    filter: none;
    cursor: default
}
.link__row-action--red {
    color: var(--color-deep-red);
}
.tr--highlight__delete td{
    background-color: #ffbdbd !important;
}

/* ----------------------------
 * Edit fields
 * ---------------------------- */
#form-edit-fields{
    display: flex;
    width: 100%;
}
.edit-fields-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    font-size: 12px;
    border: 1px solid #ccc;
    padding: 10px;
    background-color: white;
}

.edit-field-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
    /* border: 1px solid green */
}
.edit-field-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    /* border: 1px solid red */
}
.edit-field-label {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;

    max-width: 180px;
    min-width: 180px;
    color: #222;
    font-weight: 500;

    word-break: break-word;
    overflow-wrap: break-word;
}
.edit-field-label--readonly {
    color: #999;
}
.edit-field-selector {
    flex: 1;
    max-width: 26px;
    height: 100%;
    margin-right: -1px;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    border: 1px solid #ccc;
    background-color: #eeeeee;
}
.edit-field-selector--hidden {
    display: none;
}
.edit-control-container {
    flex: 2;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding-left: 5px;
    width: 100%;
    height: 100%;
    border: 1px solid #ccc;
    background-color: white;
    padding: 5px;
}
.edit-control-container--disabled {
    background-color: #eeeeee;
    pointer-events: none;
    user-select: none;
}
.edit-field-textarea {
    flex: 2;
    width: 100%;
    height: 100%;
    min-height: 30px;
    padding: 5px;
    border: none;
    resize: vertical;
    /* background-color: #eeeeee; */
    border: 1px solid #ccc;
    color: #444;
}
.edit-field-textarea:read-only{
    background-color: #eeeeee;
    pointer-events: none;
    user-select: none;
    caret-color: transparent;
}
.edit-button-row {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
}
.edit-field-error-text {
    color: red;
    margin: 0;
}
.edit-field-error-text:not(:empty) {
    margin-top: 4px;
}

/* ----------------------------
 * Filter
 * ---------------------------- */
 #form__view-filter {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    /* gap: 10px; */
    /* width: 100%;
    height: 100%; */
 }
/* ----------------------------
 * ISO-8601 Date
 * ---------------------------- */
 /* The display:inline makes it so that the span does not cause a
 line break during copy-paste */
 .iso8601-t, .iso8601-offset{
     opacity: 0.3; 
     display: inline;
}

/* ----------------------------
 * File Drop Portal
 * ---------------------------- */
#form__portal-upload{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    /* width: 100%;
    height: 100%; */
}
.file-drop-portal-instance {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border : 1px dashed #aaa;
    margin-top: 20px;
    padding: 20px;
    /* width: 100%;
    height: 100%; */
}
.file-drop__text {
    text-align: center;
}