/***********************************************************************************************************************
    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-700);
    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-600);
}

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

#sidebar ul li:hover {
    color: white;
    background-color: var(--color-primary-600);
    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/cytometa-background.jpg') bottom;
    background-size: cover;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

#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-size: var(--font-size-sm);*/
    color: white;
    background: var(--color-primary-600);
    padding: 0.5rem;
    margin-top: -0.5rem;
    border-radius: var(--radius-md);
}

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

#login button {
    padding: 10px 30px;
}

@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: var(--color-secondary-500);
}

/***********************************************************************************************************************
    Cartridge level
***********************************************************************************************************************/

.cartridge-level {
    display: inline-block;
    width: 55%;
    max-width: 80px;
    height: 10px;
    border-radius: 6px;
    background-color: var(--color-neutral-300);
    margin: 0 4px -1px 1px;
}

.cartridge-level.good {
    background-color: #22c55e;
    display: inline-block;
}

.cartridge-level.critical {
    background-color: #DC0060FF;
    display: inline-block;
}

/***********************************************************************************************************************
    Open / closed
***********************************************************************************************************************/
tr.closed td, tr.closed td span, tr.closed td a {
    text-decoration: line-through;
}


/***********************************************************************************************************************
    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
***********************************************************************************************************************/

#companyswitcher {
    width: 225px;
    height: 2.5rem;
    overflow: hidden;
    position: absolute;
    padding: 0.25rem 0.25rem;
    right: 1rem;
    top: 0.5rem;
    border-radius: var(--radius-md);
    box-shadow: rgba(3, 3, 3, 0.1) 0 1px 2px 1px;
    cursor: pointer;
}

#companyswitcher:hover {
    overflow: visible;
    height: auto;
    background-color: white;
    z-index: 99;
}

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

#companyswitcher li:hover #dropdown {
    color: white;
}

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

#companyswitcher li:hover {
    color:white;
    background-color: var(--color-primary-600);
}

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

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

.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-md);
    display: block;
    width: 100%;
    text-align: right;
    margin-bottom: -0.25rem;
}

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

/***********************************************************************************************************************
    Plots
***********************************************************************************************************************/

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

.plot {
    width: calc(33.33% - 1.5rem + 1.5rem / 3);
}

#plots img {
    cursor: zoom-in;
}

@media screen and (max-width: 768px) {
    .plot {
        width: 100%;
    }
}

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

.pagination {
    margin-right: 1rem;
}

/***********************************************************************************************************************
    Devices
***********************************************************************************************************************/

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

.device {
    width: calc(33% - 1.5rem + 1.5rem / 3);
}

.device img {
    margin: 0 auto 1.5rem;
    width: 250px;
    display: block;
}
.device dl {
    margin-bottom: 1.5rem;
    grid-template-columns: 1fr 1fr;
}

.device dt, .device dd{
    padding: 0.5rem 0.5rem;
}

.device .actions {
    font-size: var(--font-size-md);
}

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

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

/***********************************************************************************************************************
    Locations
***********************************************************************************************************************/

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

.location {
    width: calc(33% - 1.5rem + 1.5rem / 3);
}

.location img {
    margin: 0 auto 1.5rem;
    width: 100%;
    max-width: 330px;
    border-radius: var(--radius-md);
    display: block;
}
.location dl {
    margin-bottom: 1.5rem;
    grid-template-columns: 1fr 1fr;
}

.location dt, .location dd{
    padding: 0.5rem 0.5rem;
}

.location p {
    font-size: var(--font-size-sm);
}

.location .actions {
    font-size: var(--font-size-md);
}

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

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

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

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

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

.two-columns .small-column {
    width: calc(33% - 1.5rem + 1.5rem / 2);
}

.two-columns .wide-column {
    width: calc(67% - 1.5rem + 1.5rem / 2);
}

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

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


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

.device-metric {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.device-metric .chart {
    width: calc(75% - 1.5rem + 1.5rem / 2);
}

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

@media screen and (max-width: 1024px) {
    .device-metric .chart {
        width: calc(67% - 1.5rem + 1.5rem / 2);
    }

    .device-metric .stats {
        width: calc(33% - 1.5rem + 1.5rem / 2);
    }
}

@media screen and (max-width: 440px) {
    .device-metric .chart, .device-metric .stats {
        width: 100%;
    }
}

.stats dl {
    grid-template-columns: 1fr 1fr;
}

.stats dd, .stats dt {
    padding: 0.33rem 0 0.33rem 0.33rem;
}

/* support 1/2 columns */
.stats-small {
    display: none;
}
.two-columns .stats {
    display: none;
}
.two-columns .stats-small {
    display: block;
}
.two-columns .chart {
    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: 1rem;
    outline: solid 1px var(--color-neutral-600);
    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-600);
}


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

/***********************************************************************************************************************
    Export
***********************************************************************************************************************/

.export ul {
    padding-left: 1rem;
    width: 100%;
}

.export ul.devices {
    padding-left: 1.5rem;
    padding-top: 0.5rem;
}

.export ul.metrics {
    padding-top: 0.5rem;
    padding-left: 1.5rem;
    padding-bottom: 0.5rem;
}

.export li {
    list-style: none;
    padding-top: 0.5rem;
}

.export input[type="checkbox"], .export input[type="radio"] {
    margin-right: 0.5rem;
}

.export button {
    margin-top: 2rem;
}

@media screen and (max-width: 440px) {
    .export-period-dates {
        white-space: nowrap;
        padding-left: 1.3rem;
        padding-top: 0.5rem;
        display: block;
    }
}

/***********************************************************************************************************************
    Links displayed as buttons
***********************************************************************************************************************/

.button {
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--color-neutral-50);
    background-color: var(--color-primary-600);   text-decoration: none;
    border-radius: 0.375rem;
    font-size: 14px;
    font-weight: 600;
    min-width: 75px;
    display:inline-block;
    text-align: center;
}

.button:hover {
    color: var(--color-neutral-50);
    background-color: var(--color-primary-700);
    text-decoration: none;
}

/* Range

*/

.button.inactive {
    background-color: var(--color-neutral-200);
    color: var(--color-neutral-700);
}
.button.inactive:hover {
    color: var(--color-neutral-50);
    background-color: var(--color-primary-700);
    text-decoration: none;
}

.button.left {
    border-radius: 0.375rem 0 0 0.375rem;
    margin-right: 0;
}
.button.right {
    border-radius: 0 0.375rem 0.375rem 0;
    margin-left: 0;
}
.button.middle {
    border-radius: 0;
    margin-right: 0;
    margin-left: 0;
}