* {
    margin: 0;
    padding: 0;
}

body>* {
    width: 85vw;
    margin: auto;
}

a {
    cursor: pointer;
    color: #3354b5;
}

#search {
    width: calc(100% - 0.6em - 4px);
    padding: 0.3em;
}

#activities {
    display: flex;
    max-height: 0;
    transition: max-height 0.2s ease-out;
    overflow: hidden;
}

#activities>* {
    padding: 0.5em;
}

table {
    width: 70vw;
    margin-top: 1em;
    margin-bottom: 1em;
    border: solid 1px grey;
    border-radius: 5px;
    border-collapse: collapse;
}

thead tr {
    height: 4em;
}

thead th:nth-child(3) {
    width: 4em;
}

thead th:nth-child(4) {
    width: 9em;
}

thead th:nth-child(5) {
    width: 2em;
}

thead th:nth-child(7) {
    width: 2em;
}

tbody tr {
    border-top: solid 1px grey;
    min-height: 5em;
}

tbody td {
    padding: 1em;
    min-height: 7ch;
}

#pagination-control {
    display: flex;
    justify-content: space-between;
}

#page-count-control {
    display: flex
}

#page-count-control select {
    margin-left: 0.5em;
}

#page-count-control p {
    margin: 0;
}

#pagination-page-select * {
    margin: 0.2em;
    font-size: 0.9em;
}

#pagination-page-select {
    display: flex;
}

#filters>div:first-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 1em;
}

#filters p {
    margin: 0
}

#filters input {
    width: calc(100% - 0.6em - 4px);
    padding: 0.3em;
    margin-bottom: 0.5em;
}

#graph-container>div {
    position: relative;
    width: min-content;
    margin: auto;
    overflow: hidden;
}

svg {
    width: auto;
    height: 90vh;
    font: 10px sans-serif;
    margin: auto;
    border: solid 1px grey;
    border-radius: 5px;
    max-width: 85vw;
}

svg text {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

span.zoom {
    position: absolute;
    font-size: 2.3em;
    left: 1.2em;
    border: solid 2px gray;
    border-radius: 5px;
    background: white;
    cursor: pointer;
    -webkit-user-select: none;
    /* Safari */
    -moz-user-select: none;
    /* Firefox */
    -ms-user-select: none;
    /* IE10+/Edge */
    user-select: none;
    /* Standard */
    display: none;

}

#zoom-in {
    top: 1.2em;
}

#zoom-out {
    top: 2.6em
}

#svg-container {
    line-height: 0;
}

#side-panel {
    width: 30em;
    left: 100%;
    height: calc(100% - 2px - 1em);
    background-color: rgba(226, 226, 226, 0.932);
    border: solid 1px grey;
    border-radius: 5px;
    position: absolute;
    top: 0;
    padding: 0.5em;

    transition: left 0.3s;
    pointer-events: none;
}

#side-panel.open {
    left: calc(100% - 30em - 2px - 1em);
}

#close-button {
    display: flex;
    justify-content: flex-end;
    user-select: none;
    cursor: pointer;
    pointer-events: all;
}

#side-panel-data,
#side-panel-aggregation {
    display: grid;
    grid-template-columns: fit-content(40%) 1fr;
    column-gap: 0.5em;
}

#side-panel h2 {
    margin-bottom: 1em;
}

#side-panel-data span,
#side-panel-aggregation span,
#side-panel h2 {
    pointer-events: all;
}

#side-panel-aggregation span {
    margin-bottom: 0.4em;
}

.side-panel-gap {
    min-height: 0.3em;
    margin-bottom: 0.3em;
    grid-column: 1 / 3;
    border-bottom: 1px solid black
}

#side-panel-activity-uuid,
#side-panel-product-uuid {
    word-break: break-all;
}

#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    background-color: rgba(255, 255, 255, 0.836);
}

#loading-screen.loading {
    display: block;
}

#spinner {
    width: 5vw;
    height: 5vw;
    border-top: solid 5px black;
    border-bottom: solid 5px black;
}

.context-menu {
    position: absolute;
    display: none;
    flex-direction: column;
    top: 0;
    left: 100%;
    width: max-content;
    border: solid 1px black;
    border-radius: 5px;
    cursor: pointer;
}

.context-menu p {
    background-color: rgba(248, 248, 248, 0.966);
    padding: 0.5em
}

.context-menu p:hover {
    background-color: rgba(202, 202, 202, 0.966);
}

.context-menu>* {
    border: solid 1px black
}

@keyframes spinning {
    from {
        transform: rotate(0);
    }

    to {
        transform: rotate(360);
    }
}

#sidebar {
    width: 20em;
    height: calc(100vh - 1em);
    position: absolute;
    top: 0;
    left: 0;
    background-color: white;
    border: solid 1px black;
    border-radius: 0px 20px 20px 0px;
    padding: 0.5em;
    transition: transform 0.2s;
    transform: translate(0);
    z-index: 1;
}

#sidebar.close {
    transform: translate(-100%);
}

#sidebar #sidebar-open {
    display: none;
    transition: display 0s linear 0.2s;
}

#sidebar.close #sidebar-open {
    display: block;
}

#sidebar-close {
    display: flex;
    justify-content: end;
    cursor: pointer;
    user-select: none;
}

#sidebar-open {
    position: absolute;
    left: calc(100% + 0.5em);
    font-size: 32px;
    top: 1em;
    font-weight: bolder;
    cursor: pointer;
    user-select: none;
}

#sidebar-colouring {
    position: relative;
}

#sidebar-colouring-input-container {
    display: flex;
    align-items: flex-start;
}

#sidebar-colouring-input-container>span:first-child {
    margin-right: 4px;
}

#sidebar-colouring-input-container>span:last-child {
    margin-left: 4px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    --widget-size: 1em;
    cursor: pointer;
    transition: .4s;
    position: relative;
    width: calc(2 * var(--widget-size) + 8px);
    display: inline-block;
    height: calc(var(--widget-size) + 8px);
    background-color: #ccc;
}

.slider:before {
    position: absolute;
    content: "";
    height: var(--widget-size);
    width: var(--widget-size);
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:focus+.slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
    transform: translateX(var(--widget-size));
}

/* Rounded sliders */
.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

#svg-legend {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(2, auto);
    column-gap: 0.5em;
    margin: 1em;
    top: 0;
    right: 0;
    border: solid 1px black;
    padding: 0.5em;
    border-radius: 10px;
    background-color: white;
}