/***********************************************************************************************************************
    App layout
***********************************************************************************************************************/

#header {
    position: absolute;
    /*left: 250px;*/
    top: 0;
    right: 0;

    height: 60px;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-neutral-200);

    display: flex;
    justify-content: space-between;

    -moz-transition: left 0.5s ease;
    transition: left 0.5s ease;
}

#header > div {
    width: 33%;
    text-align: center;
}

#header > div:first-child {
    text-align: left;
}

#header > div:last-child {
    text-align: right;
}

#header .logo {
    height: 32px;
}

#sidebar {
    position: absolute;
    /*left: 0;*/
    top: 0;
    bottom: 0;

    width: 250px;
    padding: 0.875rem 1rem;
    border-right: 1px solid var(--color-neutral-200);

    -moz-transition: left 0.5s ease;
    transition: left 0.5s ease;

    display: flex;
    flex-wrap: wrap;
    align-content: space-between;
}

#sidebar div {
    width: 100%;
}

#sidebar .logo {
    width: 218px;
    height: 60px;
    padding: 0.5rem
}

#sidebar ul {
    padding: 0;
}

#sidebar ul li {
    color: var(--color-neutral-600);
    list-style: none;
    padding: 0.675rem 0.5rem 0.5rem 0.5rem;
    margin: 0.25rem 0.5rem 0.25rem 0;
    width: 100%;
    display: inline-flex;
    vertical-align: middle;
    cursor: pointer;
}

#sidebar ul li.active {
    color: var(--color-primary-500);
}

#sidebar ul li span {
    margin: -0.125rem 0.5rem 0 0.375rem;
}

#sidebar ul li:hover {
    color: white;
    background-color: var(--color-primary-500);
    border-radius: var(--radius-md);
}

#main {
    position: absolute;
    top: 60px;
    /*left: 250px;*/
    right: 0;
    bottom: 0;

    overflow: auto;
    padding: 1.5rem;
    background-color: var(--color-neutral-50);

    -moz-transition: left 0.5s ease;
    transition: left 0.5s ease;
}

#toggle-sidebar {
    display: none;
}

#toggle-sidebar-label {
    z-index: 2;
    position: absolute;
    top: 16px;
    left: 266px;

    cursor: pointer;

    -moz-transition: left 0.5s ease;
    transition: left 0.5s ease;
}


/* Sidebar sliding based on checkbox - default open bigger screens */
#header .logo {
    display: none;
}
#sidebar .logo {
    margin-bottom: 1.5rem;
}
#header {
    left: 250px;
}
#toggle-sidebar:checked ~ #header {
    left: 0;
}

#sidebar {
    left: 0;
}
#toggle-sidebar:checked ~ #sidebar {
    left: -250px;
}

#main {
    left: 250px;
}

#toggle-sidebar:checked ~ #main {
    left: 0;
}
#toggle-sidebar-label {
    left: 266px;
}
#toggle-sidebar:checked ~ #toggle-sidebar-label {
    left: 16px;
}



/* Sidebar sliding based on checkbox - default closed on small screens */
@media screen and (max-width: 1280px) {

    #header .logo {
        display: block;
        margin: auto;
    }
    #sidebar .logo {
        display: none;
    }

    #header {
        left: 0;
    }
    #toggle-sidebar:checked ~ #header {
        left: 250px;
        right: -250px;
    }

    #sidebar {
        left: -250px;
    }
    #toggle-sidebar:checked ~ #sidebar {
        left: 0;
    }

    #main {
        left: 0;
    }
    #toggle-sidebar:checked ~ #main {
        left: 250px;
        right: -250px;
    }
    #toggle-sidebar-label {
        left: 16px;
    }
    #toggle-sidebar:checked ~ #toggle-sidebar-label {
        left: 266px;
    }

}

@media screen and (max-width: 768px) {
    /* Hide logo on mobile as it does not fit */
    #header .logo {
        display: none;
    }
    #sidebar .logo {
        display: block;
    }
    #main {
        padding: 1rem;
    }
}


/***********************************************************************************************************************
    Login layout
***********************************************************************************************************************/

#login {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#login:before{
    content: "";
    background: url('/static/background.jpg');
    background-size: cover;
    opacity: 0.6;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    filter: grayscale(1);
}

#login .panel {
    position: relative;
    width: 400px;
    padding: 2rem;

}

#login .logo {
    width: 80%;
    margin: auto;
}

#login .logo:before {
    text-align: center;
}

#login p {
    margin: 2rem 0;
    text-align: center;
}

#login label {
    width: 100%;
    display: inline-block;
    font-size: var(--font-size-xs);
}

#login label:first-child {
    margin-top: 1rem;
}

#login input {
    width: 100%;
    margin: 0.375rem 0 1rem;
    padding: 0.25rem 0.125rem;
    border-color: var(--color-neutral-300);
    border-style: solid;
    border-width: 0 0 1px;
    /*font-size: var(--font-size-sm);*/
}

#login input:focus {
    outline: none;
}

#login #forgotpassword {
    float: left;
    font-size: var(--font-size-sm);
    line-height: 2rem;
}

#login .error {
    font-style: italic;
    font-size: var(--font-size-md);
}

@media screen and (max-width: 768px) {
    #login:before {
        background: none;
    }

    #login .panel {
        box-shadow: none;
    }
}


/***********************************************************************************************************************
    Online status
***********************************************************************************************************************/

.online, .offline {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid white;
    border-radius: 9999px;
    margin-bottom: -1px;
}

.online {
    background-color: #22c55e;
}

.offline {
    background-color: #f5234b;
}

.good, .critical, .empty {
    display: inline-block;
    width: 1.25rem;
    height: 0.75rem;
    border: 2px solid white;
    border-radius: 9999px;
    margin-bottom: -2px;
}

.good {
    background-color: #1ec337;
}

.critical {
    background-color: var(--color-primary-500);
}

.empty {
    background-color: var(--color-neutral-300);
}

/***********************************************************************************************************************
    Session Information
***********************************************************************************************************************/
#session {
    border-top: 1px solid var(--color-neutral-300);
    padding-top: 1rem;
    padding-left: 1rem;
}
#session p {
    margin-bottom: 0.5rem;
    font-size: var(--font-size-sm);
}


/***********************************************************************************************************************
    Session Information
***********************************************************************************************************************/

#departmentswitcher {
    position: absolute;
    right: 388px;
    top: 0.5rem;
}

#plangroupswitcher {
    position: absolute;
    right: 200px;
    top: 0.5rem;
}

@media screen and (max-width: 768px) {
    #departmentswitcher {
        right: 192px;
        top: 0.5rem;
    }
    #plangroupswitcher {
        display: none;
    }
}

#plangroupswitcher:hover .switcher, #departmentswitcher:hover .switcher {
    display: block;
    overflow: auto;
    height: auto;
    min-height: 2.5rem;
    max-height: 348px;
    background-color: white;
    z-index: 99;
}

.switcher {
    position: absolute;
    width: 175px;
    height: 2.5rem;
    overflow: hidden;
    padding: 0.25rem 0.25rem;
    border-radius: var(--radius-md);
    box-shadow: rgba(3, 3, 3, 0.1) 0 1px 2px 1px;
    cursor: pointer;
}

.switcher.list {
    display: none;
    top: 2.6rem;
}


.switcher #dropdown {
    float: right;
    margin-right: -0.25rem;
    margin-top: -0.25rem;
}

.switcher li:hover #dropdown {
    color: white;
}

.switcher li {
    list-style: none;
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-radius: var(--radius-md);
}

.switcher li:hover {
    color:white;
    background-color: var(--color-primary-500);
}

/***********************************************************************************************************************
    Metrics
***********************************************************************************************************************/

#metrics {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
    max-width: 1300px;
}

.metric {
    width: calc(25% - 1.5rem + 1.5rem / 4);
}

.metric .title {
    font-size: var(--font-size-sm);
    display: block;
    width: 100%;
    margin-top: -0.5rem;
}

.metric .value {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
    color: var(--color-primary-500);
    display: block;
    width: 100%;
    text-align: right;
    margin-top: 0.5rem;
    margin-bottom: -0.5rem;
}

@media screen and (max-width: 768px) {
    .metric {
        /*width: calc(50% - 1.5rem + 1.5rem / 2);*/
        width: 100%;
    }
}

/***********************************************************************************************************************
    Pagination
***********************************************************************************************************************/

.pagination {
    margin-right: 1rem;
}


/***********************************************************************************************************************
    Two columns
***********************************************************************************************************************/

.two-columns {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
    width: 100%;
    max-width: 1300px;
}

.two-columns .panel {
    width: calc(50% - 1.5rem + 1.5rem / 2);
}

@media screen and (max-width: 1024px) {
    .two-columns .panel  {
        width: calc(50% - 1.5rem + 1.5rem / 2);
    }
}

@media screen and (max-width: 440px) {
    .two-columns .panel {
        width: 100%;
    }
}

/***********************************************************************************************************************
    Parameters
***********************************************************************************************************************/

#parameters .wrapper {
    display: flex;
    flex-wrap: wrap;
}
#parameters label {
    width: 120px;
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

#parameters input, #parameters select {
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
    font-size: var(--font-size-sm);
    height: 32px;
    line-height: 32px;
    border: 0;
    border-radius: var(--radius-md);
    margin-right: .75rem;
    outline: solid 1px var(--color-neutral-500);
    outline-offset: 0;
}

#parameters .confirm {
    text-align: left;
    flex-grow: 4;
}

#parameters .parameter {
    padding: 2px;
}



/***********************************************************************************************************************
    Overlay
***********************************************************************************************************************/
#overlay {
    display: none;
    position: absolute;
    z-index: 999;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;

    background: rgba(0, 0, 0, 30%);
    justify-content: center;
    align-items: center;
}

#overlay .panel {
    max-width: 90%;
    max-height: 90%;
    height: fit-content;
    width: fit-content;
}

#overlay .close {
    margin-top: -0.5rem;
    margin-right: -0.5rem;
    text-align: right;
    overflow: visible;
}

#overlay .close span {
    cursor: pointer;
    color: var(--color-primary-500);
}


a.icon:hover {
    text-decoration: none;
}

/***********************************************************************************************************************
    Tooltip
***********************************************************************************************************************/

.tooltip-container {
    cursor: pointer;
}

.tooltip-container:hover .tooltip {
    display: block;
}

.tooltip {
    position: fixed;
    white-space: nowrap;
    display: none;
    background: var(--color-primary-500);
    border-radius: var(--radius-sm);
    padding: var(--padding-sm);
    font-size: var(--font-size-sm);
    z-index: 1000;
    color: white;
    margin-left: 12px;
    margin-top: 12px;
}

.status {
    display: inline-block;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    padding: var(--padding-sm);
    width: 100px;
    text-align: center;
}

.status.delayed {
    background-color: #f5234b;
    color: white;
}

.status.new {
    background-color: #848489;
    color: white;
}

.status.accepted {
    background-color: #1ec337;
    color: white;
}

.status.started {
    background-color: #2ea7bd;
    color: white;
}

.status.finished {
    background-color: #3634a3;
    color: white;
}

.status.cancelled {
    background-color: #f5234b;
    color: white;
}

/* alert statuses */
.status.open {
    background-color: #3634a3;
    color: white;
}
.status.closed {
    background-color: #1ec337;
    color: white;
}
.status.expired {
    background-color: #848489;
    color: white;
}

dd span.status {
    height: 22px;
    line-height: normal;
    margin-top: 4px;
}

th.status-cell, td.status-cell {
    padding: 3px;
    text-align: center;
}

th.status-cell:last-child, th.status-cell:last-child {
    padding-right: 0.5rem;
}

th .status {
    width: auto;
    padding: 0.25rem 0.5rem;
}

.timeliness {
    display: inline-block;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    padding: var(--padding-xs);
    width: 18px;
    text-align: center;
    font-weight: bold;
}
.timeliness.late {
    background-color: #f5234b;
    color: white;

}

/* ----------------------------------------------------------
    Leaflet
---------------------------------------------------------- */

#map {
    height: 800px;
    max-height: calc(100vh - 120px);
    width: 100%;
}


/* ----------------------------------------------------------
    Sorting
---------------------------------------------------------- */

.sorted-asc::after {
    content: " \2193";
}
.sorted-desc::after {
    content: " 	\2191";
}

/* ----------------------------------------------------------
    Multi-select
---------------------------------------------------------- */

.multiselect {
    width: 300px;
    margin-right: 12px;
}

.selectBox {
    position: relative;
}

.selectBox select {
    width: 100%;
}

.overSelect {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

#checkboxes {
    display: none;
    border: 1px #dadada solid;
    z-index: 999;
    position: absolute;
    width: 300px;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

#checkboxes label {
    display: block;
    width: 300px;
    font-weight: normal;
    padding: 10px 0 2px;
    margin-bottom: 0;
    color: rgb(74, 85, 104);
}

#checkboxes input {
    margin-left: 10px;
    margin-right: 8px;
    border: 0 solid;
    outline: 0;
    height: 18px;
    vertical-align: text-top;
}

#checkboxes label:hover {
    color: white;
    background-color: var(--color-primary-500);
}