body{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: grid;
    gap: 0;
    grid-template-rows: 8vh 90vh 2vh;
    font-family: 'Roboto', sans-serif;
    font-size: 0.8rem;
}

h1, h2, h3, h4 {
    margin: 0;
}

header.header {
    padding: 0.2rem 1rem;
    background:#8dc1e2;
    overflow: hidden;
}

header.header h1 {
    margin: 0;
}

header.header div.signals-container p {
    margin: 0.1rem;
    padding: 0.1rem 0.5rem;
    border-radius: 0.7rem;
    border-left: 3px solid #5350ff;
    background: #fff;
    font-size: 0.7rem;
}

span.emoji-container.critical {
    background: #ff5050;
    border-radius: 50%;
}

span.emoji-container {
    background: #5350ff;
    border-radius: 50%;
}

header.header div.signals-container p.critical {
    border-left: 3px solid #ff5050;     
}

footer.footer {
    padding: 1rem;
    background:#6d6e6e;
    color: white;
    z-index: 1;
    height: 1vh;
}

/* grid container */
main.main-grid {
    display: grid;
    grid-template-columns: 10rem auto;
}

div.main-content {
    background:#fff;
    padding: 0.5rem;
}

div.main-grid {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 84vh;
}

div.select-market-container {
    max-height: 78vh;
    overflow-y: auto;
}

div.select-markets-grid {
    column-count: 3;
}

div.select-markets-grid p {
    margin: 0.5rem;
}

/* tablet breakpoint */
@media (max-width: 1000px) {
    main.main-grid {
        height: 85vh;
        display: grid;
        grid-template-columns: 1fr;
    }

    div.scrollable {
        display: block;
        padding: 0;
        overflow-x: scroll;
        overflow-y: scroll  ;
        height: 75vh;
        width: 88vw;
    }
}

a.button,
input[type=file]::file-selector-button,
input.submit {
    margin: 4px 2px;
    background: #c1e7ff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.2rem 0.5rem;
    color: rgb(0, 0, 0);
    text-decoration: none;
    text-transform:lowercase;
    font-size: 0.7rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

a.button.delete,
input.submit.delete {
    background: #fcc3c1;
}

a.button.edit {
    background: #fdf8bd;
}

input.submit.back {
    background: grey;
    color: #fff;
}

a.button.excel,
a.button.excel:hover {
    padding-left: 1.5rem;
    background-image: url("../img/excel.svg");
    background-size: 20px auto;
    background-repeat: no-repeat;
    background-position: 5px center;
}

a.button:hover, input.submit:hover {
    background: white;
    color: black;
}

div.left-sidebar {
    background:#d1d1d1;
    padding: 0.5rem;
}

div.left-sidebar nav {
    display: flex;
    flex-direction: column;
}

div.left-sidebar nav a {
    padding: 0.2rem;
    text-decoration: none;
}

div.left-sidebar nav a.active {
    background: grey;
    color: white;
    /* text-transform: uppercase; */
}

div.left-sidebar nav a:hover {
    background: white;
    color: black;
    text-decoration: none;
}

div.left-sidebar div.current-user-name * {
    margin: 0;
}

div.form-content p {
    margin: 0.5rem;
}

table,
div.scrollable {
    display: block;
    padding: 0;
    overflow-x: scroll;
    overflow-y: scroll;
    height: 100%;
    width: 100%;
}

table  {
    border-collapse: separate;
    border-spacing: 0;
}

table th, table td {
    text-align: left;
    padding: 0.2rem;
    background: #fff;
    border: 0.5px solid #ddd;
    border-right: none;
    border-left: none;
}

table th {
    vertical-align: bottom;
    text-wrap: nowrap;
    z-index: 4;
}

table td {
    text-wrap: wrap;
    vertical-align: top;
    z-index: 1;
}

table td.no-breake {
    text-wrap: nowrap;
    z-index: 1;
}

tbody td.market-amount,
thead th.market-name,
thead td.availabe {
    border-left: solid 1px #dddddd;
}

thead th.side-borders,
tbody td.side-borders {
    border-left: solid 1px #dddddd;
    border-right: solid 1px #dddddd;
}

thead th.left-borders,
tbody td.left-borders {
    border-left: solid 1px #dddddd;
}

thead th.right-borders,
tbody td.right-borders {
    border-right: solid 1px #dddddd;
}

tbody tr:nth-child(even) td{
    background: #ffffff;
}

tbody tr:nth-child(odd) td {
    background: #f1f1f1;
}

tbody tr:hover td {
    background: rgb(166, 221, 255)
}

table th.market-amount,
table th.house-amount,
table td.market-amount,
table td.house-amount {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

table.form {
    border-collapse: separate;
    border-spacing: 0;
    overflow: auto;
}

table.form th,
table.form td {
    vertical-align: middle;
    border: none;
}

table.form th {
    text-align: right;
}

table.form tr td {
    background-color: white;
}

/* STICKY */
th {
    position: sticky;
    top: 0;
    z-index: 4;
}

thead td {
    position: sticky;
    top: var(--row1-height);
    z-index: 4;
}

th:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 6;
}

th:nth-child(2) {
    position: sticky;
    left: var(--col1-width);
    z-index: 6;
}

th:nth-child(3) {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width));
    z-index: 6;
}

th:nth-child(4) {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width));
    z-index: 6;
}

th.sticky-5 {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width) + var(--col4-width));
    z-index: 6;
}

th.sticky-6 {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width) + var(--col4-width) + var(--col5-width));
    z-index: 6;
}

tbody td:nth-child(1) {
    position: sticky;
    left: 0px;
    z-index: 4;
}

tbody td:nth-child(2) {
    position: sticky;
    left: var(--col1-width);
    z-index: 4;
}

tbody td:nth-child(3) {
    overflow: visible;
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width));
    z-index: 4;
}

tbody td:nth-child(4) {
    text-wrap: wrap;
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width));
    z-index: 4;
}

tbody td.sticky-5 {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width) + var(--col4-width));
    z-index: 4;
}

tbody td.sticky-6 {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width) + var(--col4-width) + var(--col5-width));
    z-index: 4;
}

thead td.available {
    position: sticky;
    top: var(--row1-height);
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width) + var(--col4-width));
    z-index: 6;
}

thead td.available {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width) + var(--col4-width));
    z-index: 6;
}

tbody td.available {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width) + var(--col4-width));
    z-index: 3;
}

thead th.supply-date,
tbody td.supply-date {
    position: sticky;
    left: calc(var(--col1-width) + var(--col2-width) + var(--col3-width) + var(--col4-width));
    border-right: solid 1px #dddddd;
    z-index: 6;
}

/* MISC */
div.invisible-form > * {
    display: none;
}

table.login td {
    border: none;
}

div.form-asp {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

div.comment {
    grid-column: 50%;
}

div.scrollable:hover {
    z-index: 100;
}

table, tbody td:hover {
    z-index: 100;
}

td img {
    object-fit: cover
}

td img:hover {
    transform: scale(8) translate(40%, 40%);
}

tbody tr.last-rows td img:hover {
    transform: scale(6) translate(40%, -40%);
}

hr {
    margin: 0;
}

div.flex-container {
    display: flex;
}

div.hidden {
    display: none;
}

table.info,
table.nested {
    overflow: auto;
    height: auto;
    width: auto;
}

table.nested tr td {
    background: inherit;
    border: none;
    z-index: 1;
}

.errorlist {
    font-size: 1.2rem;
    color: red;
}

a.highlighted {
    text-decoration: none;
    color: #fff;
    background: red;
    border-radius: 5px;
    padding: 5px;
}

a.highlighted:hover {
    background: darkgray;
}

span.unvisible-wraper span.unvisible {
    visibility: hidden;
    width: 300px;
    position: absolute;
    padding: 10px;
    background-color: gray;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    z-index: 1;
}

span.unvisible-wraper:hover span.unvisible {
    visibility: visible;
}