
.iconWithIndex {
    cursor: pointer;
    height: max-content;
}

.iconWithIndex[index] {
    position: relative;
}

.iconWithIndex[index]::after {
    position: absolute;
    top: -5px;
    right: -1px;
    content: attr(index);
    color: var(--dark-bg-text-color);
    background-color: #F03C48;
    border-radius: 12px;
    padding: 0 3px;
    font: 500 9px Roboto, Medium, sans-serif;
}

/* clickableImage */
.ClickableImage-with-disk {
    --padding: 5px;
    --reversed-padding: -5px;

    display: inline-flex;
    align-items: center !important;
    justify-content: center;
    font: var(--font-tiny-regular);
    width: fit-content;
}

.ClickableImage-with-disk > :first-child {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.ClickableImage-with-disk > :first-child::before {
    content: ' ';
    background: transparent;
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    display: inline-block;
    top: var(--reversed-padding);
    left: var(--reversed-padding);
    right: var(--reversed-padding);
    bottom: -1px;
    transition: background var(--dialog-anim-duration) ease-in-out;
}

.ClickableImage-with-disk.with-border > :first-child {
    padding: var(--padding);
    padding-bottom: 1px;
}

.ClickableImage-with-disk.with-border > :first-child::before {
    border: solid 1px black;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.ClickableImage-with-disk:hover > :first-child::before {
    opacity: 1;
    background: var(--icon-Hover);
}

.ClickableImage-with-disk *[counter]::after {
    position: absolute;
    top: -10px;
    right: -5px;
    background-color: #89afe4;
    color: var(--dark-bg-text-color);

    border-radius: 50%;
    content: attr(counter);
    font-size: 12px;
    font-weight: bold;
    text-align: center;

    width: 20px;
    height: 20px;
    line-height: 20px
}

.ClickableImage-with-disk *[counter] {
    position: relative;
}


/**
    Button
 */

.button {
    border-radius: 5px;
    text-align: center;
    height: 40px;
    cursor: pointer;
    margin: 0 4.6px;

    font: var(--font-small-regular);

    user-select: none;

    box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14),
    0 1px 8px 0 rgba(0, 0, 0, 0.12),
    0 3px 3px -2px rgba(0, 0, 0, 0.4);
}

.simpleFileUploader-CustomUpload {
    border: solid 1px #ddd;
    cursor: pointer;
    border-radius: 5px 5px 5px 5px;
    color: #22AEE9;
    background-color: white;
    box-shadow: 2px 2px 6px #ddd;
    height: 40px;
    display: inline-flex;
    align-items: center;
    padding-left: 25px;
    padding-right: 25px;
    font: var(--font-small-medium);
}

.simpleFileUploader-customInputDisplay {
    display: none;
}

.alternate-background > :nth-child(even) {
    background-color: var(--third-bg);
}


.button:active, .button:focus {
    outline: none;

    box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14),
    0 6px 30px 5px rgba(0, 0, 0, 0.12),
    0 8px 10px -5px rgba(0, 0, 0, 0.4);
}

.button > :first-child {
    height: 100%;
    padding-left: 20px;
    padding-right: 20px;
}

.button:active > :first-child {
    position: relative;
}

.button:active > :first-child:before {
    content: ' ';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.4;
    background-color: #7f7f7f;
    border-radius: 5px;
}

.button:active > :first-child > * {
    z-index: 1;
}

.button[disabled] {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

.button.primary {
    background-color: #22AEE9;
    color: var(--dark-bg-text-color);
}

.button.secondary {
    background-color: #A1A8B8;
    color: var(--dark-bg-text-color);
}

.button.negativePrimary {
    background-color: #EF582F;
    color: var(--dark-bg-text-color);
}

.button.negativeSecondary {
    background-color: white;
    color: var(--primary-color);
}

.popupButtonOk {
    background-color: #00AF5C;
    color: var(--dark-bg-text-color);
}

.popupButtonCancel {
    background-color: #252627;
    color: var(--dark-bg-text-color);
}

.button.standardBlack {
    background-color: #252627;
    color: var(--dark-bg-text-color);
}

.button.loadingSpinner {
    color: rgba(0, 0, 0, 0);
    position: relative;
}

.loadingSpinner:before {
    content: '';
    box-sizing: border-box;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border-radius: 50%;
    border: 2px solid #ccc;
    border-top-color: #333;
    animation: spinner .6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.circledLetter {
    border-radius: 8.25px;
    width: 14.5px;
    height: 14.5px;
    text-align: center;
    font-size: 14px;
    border: solid var(--primary-dark-color) 1px;
    color: var(--primary-dark-color);
}

.circledLetter > * {
    position: relative;
    top: -1px;
}

.dialog {
    --patient-context-height: 0;
    --caption-height: 35px;
    --body-padding: 20px;
    --dialog-margin: 10px;
    --base-dark-color: #005187;
    --body-max-width: calc(100vw - var(--body-padding) * 2 - var(--dialog-margin) * 2);
    --body-max-height: calc(100vh - var(--body-padding) * 2 - var(--dialog-margin) * 2 - var(--caption-height));
    --dialog-anim-duration: 0.2s;

    --controls-padding: 15px;
    --controls-max-height: 30px;

    position: fixed;


    min-width: 300px;
    min-height: 110px;
}

.dialog.with-controls {
    --body-max-height: calc(100vh - var(--body-padding) * 2 - var(--dialog-margin) * 2 - var(--caption-height) - var(--controls-padding) * 2 - var(--caption-height));
}

.dialog.showing {
    animation-duration: var(--dialog-anim-duration);
    animation-name: openDialogAnimation;
}

.dialog.hiding {
    animation-duration: var(--dialog-anim-duration);
    animation-name: closeDialogAnimation;
}

.dialog-caption {
    background: #005187;
    background: linear-gradient(0deg, rgb(0, 81, 135) 30%, rgb(0, 138, 201) 100%);
    color: white;
    user-select: none;
    display: grid;
    grid-template-columns: minmax(10px, auto) repeat(2, min-content);
    align-items: center;
    grid-column-gap: 10px;
    padding: 0 10px;

    font-size: small;
    font-weight: bold;
}

.dialog-layout {
    display: grid;
    grid-template-rows: var(--caption-height) auto min-content;
    align-items: stretch;
    justify-items: stretch;
    border: 1px solid var(--base-dark-color);

    background: linear-gradient(0deg, rgb(191, 210, 243) 30%, rgb(255, 255, 255) 100%);
    background-position-y: var(--caption-height);
}


.dialog-caption > .caption-heading {
    margin-right: auto;
    white-space: nowrap;

    /* width overflow and text-overflow are all needed for the ellipsis */
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
}

.dialog-body-container {
    overflow: auto;
    position: relative;

    max-width: var(--body-max-width);
    max-height: var(--body-max-height);
}

.dialog-body {
    margin: var(--body-padding);
}

.dialog .resize-handle {
    background: transparent;
}

.dialog.minimized {
    max-width: 100px;
    height: var(--caption-height);
    min-height: var(--caption-height);
    max-height: var(--caption-height);
}

.dialog.transitioning {
    transition: all linear var(--dialog-anim-duration);
}

.dialog.minimized .dialog-body {
    display: none;
}

.dialog.no-body-margin {
    --body-padding: 0px;
}

.dialog-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--controls-padding);
    max-height: var(--controls-max-height);
}

:not(.dialog.with-controls) > .dialog-layout > .dialog-controls {
    display: none;
}


.dialog[disabled]::after {
    background: grey;
    opacity: 0.5;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: ' ';
    position: absolute;
    z-index: 10;
}

.glass {
    background-color: #000;
    opacity: 0.3;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
}


@keyframes openDialogAnimation {
    0% {
        opacity: 0;
        transform: scale3d(.3, .3, .3)
    }
    50% {
        opacity: 1
    }
}

@keyframes closeDialogAnimation {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale3d(.3, .3, .3)
    }
}


.drawer-panel {
    position: relative;

    display: grid;
    grid-template-columns: auto max-content;
}

.drawer-panel.drawer-left {
    grid-template-columns: max-content auto;
}

.drawer-panel.drawer-left > :first-child {
    grid-column: 2;
    grid-row: 1;
}

.drawer-panel.drawer-left > :nth-child(2) {
    grid-column: 1;
    grid-row: 1;
}

.drawer {
    --base-dark-color: #005187;
    --caption-txt-color: white;


    box-sizing: border-box;
    display: grid;
    grid-template-columns: 35px auto;
    pointer-events: none;
}

.drawer > * {
    pointer-events: all;
}

.drawer-left .drawer {
    grid-template-columns: auto 35px;
}

.drawer-caption {
    background: linear-gradient(180deg, rgb(0, 81, 135) 30%, rgb(0, 138, 201) 100%);
    color: var(--caption-txt-color);
    user-select: none;

    font-family: Arial Unicode MS, Arial, sans-serif;
    font-size: small;
    font-weight: bold;

    writing-mode: vertical-lr;
    transform: rotate(180deg);
    text-align: center;
    text-orientation: sideways;
    padding: 10px;

    cursor: pointer;
}

.drawer-caption::before {
    display: inline-block;
    content: ' ';

    width: 5px;
    height: 5px;
    transform: rotate(45deg);
    border-left: solid 1px var(--caption-txt-color);
    border-bottom: solid 1px var(--caption-txt-color);

    position: relative;
    top: -10px;
    left: 3px;
}

.drawer-panel:not(.drawer-left) > .drawer.opened > .drawer-caption::before, .drawer-panel.drawer-left > .drawer:not(.opened) > .drawer-caption::before {
    transform: rotate(225deg);
    left: 0px;
}

.drawer-body {
    max-height: 100%;
    overflow: auto;
    background: linear-gradient(0deg, rgb(191, 210, 243) 30%, rgb(255, 255, 255) 100%);
    padding: 20px;
}

.drawer-panel.no-body-margin .drawer-body {
    padding: 0;
}

.drawer:not(.opened) > .drawer-body {
    display: none;
}

.drawer-panel.floating .drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
}

.drawer-panel.floating.drawer-left .drawer {
    right: unset;
    left: 0;
}

.drawer-panel.floating .drawer.opened {
    max-width: 80%;
}

.drawer-panel.floating .drawer-body {
    border: solid 1px var(--base-dark-color);
}

.drawer-panel.floating .drawer-caption {
    border: solid 1px var(--base-dark-color);
    align-self: flex-start;
    margin-top: 20%;
    padding: 25px 10px;

    position: relative;
    top: 20%;
}

.drawer-panel.docked .drawer {
    border: solid 1px var(--base-dark-color);
}


.drawer-left .drawer-caption {
    grid-row: 1;
    grid-column: 2;
}

.drawer-left .drawer-body {
    grid-row: 1;
    grid-column: 1;
}

/* TODO POC-AsyncTree do proper css for colors etc */
.tree-sibling-container {
    display: grid;
    grid-template-columns: repeat(1, auto);
    padding-left: 15px;
    grid-column: 1 / -1;
}

.tree-sibling-container > *:not(.tree-sibling-container) {
    padding: 1px;
    padding-right: 4px;
}

.dropMenu, .dropMenu-item-container {
    display: inline-block;
    background: whitesmoke;
    cursor: default;
}

.dropMenu-sub-menu {
    padding: 2px 5px;
    border: 1px solid grey;
    position: relative;
    display: flex;
    min-width: 200px;
    min-height: 16px;
    white-space: nowrap;
}

.dropMenu-sub-menu:after {
    content: '▶';
    margin-left: auto;
    padding-left: 10px;
}

.dropMenu-item-container {
    position: absolute;
    border: 1px solid grey;
    left: 205px;
    top: 0;
}

.dropMenu-item {
    padding: 2px 5px;
    min-width: 150px;
    left: 40px;
    background-color: white;
    z-index: 3000;
    white-space: nowrap;
    cursor: pointer;
}

.dropMenu-item-impair {
    background: #e7e7e7;
}

.dropMenu-sub-menu:hover, .dropMenu-item:hover {
    background-color: #99c4d2;
    z-index: 3000;
}

.dropMenu-sub-menu:not(:hover) > .dropMenu-item-container {
    display: none;
}

.tree-root {
    border: solid 1px cornflowerblue;
}

.tree-branch {
    grid-column: 1 / -1;
    margin-left: -15px;
    font-weight: bold;
}

.tree-leaf-cell {
    white-space: nowrap;
    align-self: center;
}

.tree-leaf-cell-auto {
    white-space: pre-line;
    align-self: center;
}

.tree-leaf-row-even {
    color: black;
}

.tree-leaf-row-odd {
    color: #5D5D5DFF;
}

.link {
    color: #2E609F;
    text-decoration: underline;
    cursor: pointer;
}

.notif-toast {
    right: 7px;
    top: 100px;
}

.notif-toast .notif-group {
    box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14),
    0 1px 8px 0 rgba(0, 0, 0, 0.12),
    0 3px 3px -2px rgba(0, 0, 0, 0.4);
}

.notif-panel {
    position: fixed;
    right: 7px;
    top: 7px;

    background: rgb(191, 210, 243);

    border-radius: 7px;
    overflow: clip;

}

.notif-header {
    display: flex;
    justify-content: space-between;

    background: #005187;
    background: linear-gradient(0deg, rgb(0, 81, 135) 30%, rgb(0, 138, 201) 100%);
    color: white;
    user-select: none;

    padding: 10px 25px;
}

.notif-clear-all {
    cursor: pointer;
    padding: 3px 2px;
    border: solid 1px whitesmoke;
    background: #5195ef;
    border-radius: 5px;
}

.notif-group {
    width: 450px;
    padding: 3px 15px;

    background: rgb(242 247 255);

    margin: 10px;

    border-radius: 5px;
}

.notif-group-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 0px;
}

.notif-body {
    display: flex;
    padding: 7px 0px;
}

.notif-body:not(:last-child) {
    border-bottom: 1px solid rgb(177 200 239)
}

.notif-body > *:not(:last-child) {
    margin-right: 7px;
}

.notif-remove {
    visibility: hidden;
    cursor: pointer;
    margin-left: auto;
}

.notif-body:hover .notif-remove {
    visibility: unset;
}

.notif-group:hover .notif-group-header > .notif-remove {
    visibility: unset;
}

.notif-container {
    max-height: calc(100vh - 100px);
    overflow: auto;
}