﻿:root {
    --mainBlue: #1E88E5;
    --darkBlue: #0D47A1;
    --mainWhite: white;
    --disableGray: #ececec;
    --borderGray: lightGray;
    --mainGradient: linear-gradient(360deg, rgba(30, 136, 229, 1) 62%, rgba(21, 101, 192, 1) 100%);
    --mainGradientLeft: linear-gradient(270deg, rgba(30, 136, 229, 1) 62%, rgba(21, 101, 192, 1) 100%);
}

html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 12px;
    overflow: hidden;
}

.page-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    height: 100%;
    min-height: 0;
    padding-bottom: 0;
}

.card {
    box-sizing: border-box;
    padding-top: 16px;
    padding-left: 16px;
    padding-right: 16px;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    background-color: white;
    border-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

#device-container .card-discovery,
#device-container .information-card {
    width: 100%;
    max-height: calc(100vh - 180px);
    overflow: auto;
    margin: 0;
}

#device-container .card,
#device-container .card-discovery {
    flex: none;
}

.card-discovery {
    flex: 0 0 60%;
    box-sizing: border-box;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: white;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-color: none !important;
}

.device-row {
    border-top: 1px solid #D0D0D0;
    border-right: 1px solid #D0D0D0;
    border-bottom: 1px solid #D0D0D0 !important;
    border-left: 12px solid #D0D0D0;
}

.device-row.selected {
    border-top: 1px solid #0072C6;
    border-right: 1px solid #0072C6;
    border-bottom: 1px solid #0072C6 !important;
    border-left: 12px solid #0072C6;
    background-color: rgba(0, 114, 198, 0.1) !important;
}


.mainLogo {
    max-height: 100%;
    max-width: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
    border-radius: 10px;
}

.btn-primary {
    width: 175px;
    background-color: #0072C6;
}

.btn-primary:hover {
    background-color: #0081df !important;
}

.btn-white {
    background-color: white !important;
    border: 1px solid #0072C6 !important;
    color: black !important;
}

.btn-white:hover {
    background-color: #0072C6 !important;
    color: white !important;
}

.btn-danger {
    background-color: #d9534f !important;
    border: none !important;
    color: white !important;
}

.btn-danger:hover {
    background-color: #c9302c !important;
    color: white !important;
}

.btn-wrapper {
    display: flex;

}

.btn-wrapper-end {
    justify-content: flex-end;
}

h1 {
    color: white;
    font-weight: bold;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0071c1;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    flex: 1;
    min-height: 0;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
    overflow-y: auto;
    border-top-left-radius: 10px;
    background-color: #F1F1F1;
}

.page.theme-calibration .content {
    padding-top: 0;
    padding-bottom: 0;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: #58151c;
    font-size: 12px;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #c02d76;
}

.form-floating>.form-control-plaintext::placeholder,
.form-floating>.form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating>.form-control-plaintext:focus::placeholder,
.form-floating>.form-control:focus::placeholder {
    text-align: start;
}

.main-block {
    background-color: white;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid #ccc;
}

.main-card {}

.project-subcard {
    display: block !important;
    border-top: 1px solid #D0D0D0;
    border-right: 1px solid #D0D0D0;
    border-bottom: 1px solid #D0D0D0 !important;
    border-left: 12px solid #D0D0D0;
    margin: 0;
    padding: 12px 16px;
    cursor: pointer;
    background: white;
}

.project-subcard:hover {
    background-color: rgba(0, 114, 198, 0.05);
    border-left-color: #0072C6;
}

.project-subcard.selected {
    border-top: 1px solid #0072C6;
    border-right: 1px solid #0072C6;
    border-bottom: 1px solid #0072C6 !important;
    border-left: 12px solid #0072C6 !important;
    background-color: rgba(0, 114, 198, 0.1) !important;
}

.project-subcard:not(:last-child).selected {
    border-bottom: 1px solid #0072C6 !important;
}

.project-subcard:not(:last-child) {
    border-bottom: 1px solid #D0D0D0 !important;
}

.project-subcard:first-child {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.project-subcard:last-child {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

.card-title {
    /*    padding-bottom: 16px;
    margin-bottom: 16px;*/
}

.final-button-wrapper {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    width: 100%;
    padding-bottom: 16px !important;
}

.final-button {
    margin-top: 8px !important;
    margin-bottom: 0px !important;
}

.form-group {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px !important;
}

.main-card {}

.status-bar {
    margin-bottom: 12px;
    color: green;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #00cc00;
    border-radius: 4px;
    margin-top: 4px;
}

.button-row {
    display: flex;
    justify-content: flex-start;
    gap: 16px;
}

.btn-primary {
    background-color: #0072C6 !important;
    border: none;
    padding: 6px 20px;
    font-weight: 600;
    width: 175px;
    height: 38px;
    box-sizing: border-box;
}

.btn-white {
    background-color: white !important;
    border: 1px solid #0072C6;
    color: black;
    padding: 6px 20px;
    font-weight: 600;
    width: 175px;
    height: 38px;
    box-sizing: border-box;
}

.btn-white:hover {
    background-color: #0072C6;
    color: white;
}

.top-line {
    border-bottom: 1px solid #0072C6;
    width: 100%;
}

.bottom-line {
    border-bottom: 1px solid #0072C6;
    width: 100%;
}

.page.theme-calibration .btn-primary {
    background-color: #80C9FF !important;
    color: #1a1a1a !important;
}

.page.theme-calibration .btn-primary:hover:not(:disabled) {
    background-color: #6ABDE8 !important;
}

.page.theme-calibration .btn-white {
    border-color: #80C9FF;
}

.page.theme-calibration .btn-white:hover {
    background-color: #80C9FF !important;
}

.page.theme-das .btn-primary {
    background-color: #ea700d !important;
    border-color: #ea700d !important;
}

.page.theme-das .btn-primary:hover:not(:disabled) {
    background-color: #c55d0a !important;
    border-color: #c55d0a !important;
}

.page.theme-das .btn-white {
    border-color: #ea700d;
}

.page.theme-das .btn-white:hover {
    background-color: #ea700d !important;
}

.logout-theme.theme-calibration .btn-primary {
    background-color: #80C9FF !important;
    color: #1a1a1a !important;
}

.logout-theme.theme-calibration .btn-primary:hover:not(:disabled) {
    background-color: #6ABDE8 !important;
}

.logout-theme.theme-calibration .btn-white {
    border-color: #80C9FF !important;
}

.logout-theme.theme-calibration .btn-white:hover {
    background-color: #80C9FF !important;
}

.logout-theme.theme-calibration .dialog-header {
    border-bottom-color: #80C9FF !important;
}

.logout-theme.theme-das .btn-primary {
    background-color: #ea700d !important;
    border-color: #ea700d !important;
    color: #fff !important;
}

.logout-theme.theme-das .btn-primary:hover:not(:disabled) {
    background-color: #c55d0a !important;
    border-color: #c55d0a !important;
}

.logout-theme.theme-das .btn-white {
    border-color: #ea700d !important;
}

.logout-theme.theme-das .btn-white:hover {
    background-color: #ea700d !important;
}

.logout-theme.theme-das .dialog-header {
    border-bottom-color: #ea700d !important;
}

.btn-primary:disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
}

.btn-ppd-armed {
    width: 175px;
    background-color: #ffcc00 !important;
    color: #000000 !important;
    border: none;
    padding: 6px 20px;
    font-weight: 600;
    height: 38px;
    box-sizing: border-box;
}

.export-buttons-flow {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    gap: 8px;
    margin-top: 8px;
    padding-bottom: 16px;
}

.export-buttons-flow .btn {}

.axis-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.axis-toggle--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.axis-toggle__track {
    width: 36px;
    height: 20px;
    background-color: #0072C6;
    border-radius: 10px;
    position: relative;
    flex-shrink: 0;
}

.axis-toggle__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background-color: white;
    border-radius: 50%;
    transition: left 0.2s ease;
}

.axis-toggle__thumb--right {
    left: 18px;
}

.axis-toggle__label {
    font-size: 12px;
    font-weight: 600;
    color: #000;
    transition: opacity 0.2s ease;
}

.axis-toggle__label--inactive {
    opacity: 0.35;
}

.btn-ppd-armed:hover {
    background-color: #ffcc00 !important;
    /* keep same yellow on hover */
    color: #000000 !important;
    /* keep black text */
}

.test-card {
    display: flex !important;
    justify-content: space-between;
}

.test-card:hover {
    background-color: rgba(0, 114, 198, 0.05);
    border-left-color: #0072C6;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
    width: 100%;
    align-items: center;
}

.login-final-button-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    width: 100%;
}

.menu-label {
    white-space: nowrap;
}

.page.is-measuring {
    --sidebar-collapsed: 56px;
    --sidebar-expanded: 240px;
    --topbar-height: 64px;
}

.page.is-measuring .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-collapsed) !important;
    background: #0072C6;
    overflow: hidden;
    transition: width 150ms ease;
    z-index: 1000;
    box-shadow: none;
    padding-top: var(--topbar-height);
}

.page.is-measuring .sidebar .top-row {
    display: none;
}

.page.is-measuring .sidebar .nav-scrollable {
    overflow-y: auto;
}

.page.is-measuring .sidebar .menu-label {
    display: none;
}

.page.is-measuring .sidebar:hover {
    width: var(--sidebar-expanded) !important;
}

.page.is-measuring .sidebar:hover .menu-label {
    display: inline-block;
}

.page.is-measuring .main-content {
    margin-left: var(--sidebar-collapsed);
    transition: margin-left 0ms;
}

@media (max-width: 640px) {
    .page.is-measuring {
        --sidebar-collapsed: 52px;
        --sidebar-expanded: 220px;
    }
}

.page.is-measuring .sidebar.collapsed .nav-link {
    justify-content: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.page.is-measuring .sidebar.collapsed .nav-link span.bi {
    margin: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    width: 100%;
}

.page.is-measuring .sidebar.collapsed .menu-label {
    display: none !important;
}

.page.is-measuring .sidebar:not(:hover) .nav-item {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.page.is-measuring .sidebar:not(:hover) .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0 !important;
}

.page.is-measuring .sidebar:not(:hover) .nav-link span.bi {
    margin: 0 !important;
    position: static !important;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page.is-measuring .sidebar:not(:hover) .nav-link span {
    margin-right: 0 !important;
}

.page.is-measuring .sidebar:not(:hover) .menu-label {
    display: none !important;
}

.main-content {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.page.is-measuring .content {
    background-color: #fff !important;
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    min-height: 0;
    overflow: auto;
}

.measuring-page {
    display: grid;
    grid-template-columns: minmax(600px, 1fr) clamp(150px, 11vw, 210px);
    gap: 0;
}

.measuring-page-graph {
    padding-right: 2rem;
    min-width: 0;
    overflow: visible;
}

.measuring-page-graph .chart-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
}

.chart-container>div {
    height: 100%;
}

.measuring-page-graph canvas {
    display: block;
}


.measuring-page-graph>* {
    min-width: 0;
}

/* App-like UI: prevent accidental text selection when clicking/tapping.
   Inputs stay selectable; use user-select: text on elements whose content
   should be copyable. */
body {
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea,
select,
[contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

/* In debug mode text selection stays enabled for the whole page */
.page.debug-selectable {
    -webkit-user-select: text;
    user-select: text;
}

.measuring-page-channels {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 8px;
    box-sizing: border-box;
    background-color: #F1F1F1;
    border-left: 1px solid #D0D0D0;
    overflow-y: auto;
}

.config-btn {
    align-self: center;
    width: 175px;
    margin-bottom: 30px;
}

.channels {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.channels:not(.meta-block)>div:first-child {
    position: sticky;
    top: 0;
    background: #F1F1F1;
    z-index: 1;
    padding: 4px 0;
    border-bottom: solid black 1px;
}

.channel {
    background-color: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 100%;
    border-top: 1px solid #D0D0D0;
    border-right: 1px solid #D0D0D0;
    border-bottom: 1px solid #D0D0D0;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    align-items: center;
    padding: 6px clamp(10px, 1.2vw, 16px);
    gap: 6px;
    font-size: 13px;
}

.measurment-type {
    text-align: left;
}

.measurment-value {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
}

.measurment-unit {
    text-align: right;
    color: #555;
    white-space: nowrap;
}

@media (max-width: 1500px) {
    .channel {
        font-size: 13px;
    }
}


@media (max-width: 1100px) {
    .measuring-page {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .measuring-page-graph {
        order: 1;
    }

    .measuring-page-channels {
        order: 2;
        height: auto;
        max-height: 50vh;
    }
}

.page.is-measuring {
    --sidebar-collapsed: 56px;
    --sidebar-expanded: 240px;
    --topbar-height: 64px;
}

.page.is-measuring .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--sidebar-collapsed) !important;
    background: #0072C6;
    overflow: hidden;
    transition: width 150ms ease;
    z-index: 1000;
    padding-top: var(--topbar-height);
}

.page.is-measuring .sidebar .top-row {
    display: block;
}

.page.is-measuring .sidebar .nav-scrollable {
    overflow-y: auto;
}

.page.is-measuring .sidebar .menu-label {
    display: none;
}

.page.is-measuring .sidebar:hover {
    width: var(--sidebar-expanded) !important;
}

.page.is-measuring .sidebar:hover .menu-label {
    display: inline-block;
}

.page.is-measuring .sidebar:not(:hover) .nav-item {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.page.is-measuring .sidebar:not(:hover) .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    padding: 0 !important;
}

.page.is-measuring .sidebar:not(:hover) .nav-link span.bi {
    margin: 0 !important;
    position: static !important;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page.is-measuring .sidebar:not(:hover) .nav-link span {
    margin-right: 0 !important;
}

.page.is-measuring .sidebar:not(:hover) .menu-label {
    display: none !important;
}

.page.is-measuring .sidebar:not(:hover) .dropdown-icon {
    display: none !important;
}

.page.is-measuring .sidebar:hover .dropdown-icon,
.page:not(.is-measuring) .dropdown-icon {
    display: inline-block !important;
}


.page.is-measuring .sidebar:not(:hover) .mainLogo {
    display: none;
}

.page.is-measuring .sidebar:not(:hover) .logo-small {
    display: block;
}

.page.is-measuring .sidebar:hover .mainLogo {
    display: block;
}

.page.is-measuring .sidebar:hover .logo-small {
    display: none;
}

.page:not(.is-measuring) .sidebar .mainLogo {
    display: block;
}

.page:not(.is-measuring) .sidebar .logo-small {
    display: none;
}

.logo-small {
    border-radius: 10px;
}

#device-container {
    display: grid !important;
    grid-template-columns: 6fr 4fr !important;
    width: 100%;
    align-items: start;
}

#device-container .card {
    flex: initial !important;
    width: 100%;
    min-width: 0;
    margin: 0;
    max-height: calc(100vh - 180px);
    overflow: auto;
}

.information-card .placeholder {
    border: 1px dashed #ddd;
    border-radius: 10px;
    padding: 16px;
    color: #666;
}

#device-container .card,
#device-container .card-discovery,
#device-container .information-card {
    flex: initial !important;
}

#device-container .card-discovery {
    max-height: unset !important;
}

#device-container .device-table,
#device-container .device-row,
#device-container .device-row>* {
    min-width: 0;
    overflow: hidden;
}


.information-card.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #e6e6e6;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background-color: #0078d7;
    border-radius: 10px;
    border: 2px solid #e6e6e6;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #005fa3;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #0078d7 #e6e6e6;
}

.top-title {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #0072C6;
}

.form-devider {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 16px;
}

@media (max-width: 900px) {
    .form-devider {
        grid-template-columns: 1fr;
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: grid;
    place-items: center;
    z-index: 2000;
}

.modal-card {
    width: min(1200px, 60vw);
    max-width: 92vw;
    height: min(680px, 60vh);
    max-height: 92vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

.modal-card__header {
    padding: 16px 20px;
    border-bottom: 1px solid #D0D0D0;
}

.modal-card__section {
    padding: 10px 16px;
    overflow: auto;
}

.modal-card__footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 20px 16px;
    border-top: 1px solid #D0D0D0;
}

.modal-card__footer .footer-left {
    justify-self: start;
}

.modal-card__footer .footer-right {
    justify-self: end;
}

.section-title {
    font-weight: 600;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #D0D0D0;
}

.modal-card {
    width: 70vw;
    height: 70vh;
    max-width: 92vw;
    max-height: 92vh;
}

.multi-graphs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    height: calc(100vh - 120px);
}

.chart-cell {
    min-width: 0;
}

.multi-graphs .chart-container {
    height: auto !important;
}

.measuring-page-graph:not(.multi) .chart-container {
    height: calc(100vh - 120px);
}

.measuring-page-graph.multi .charts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 12px;
    height: calc(100vh - 120px);
    align-items: stretch;
}

.measuring-page-graph.multi .mini-chart {
    min-width: 0;
    display: flex;
}

.measuring-page-graph.multi .mini-chart .chart-container {
    flex: 1 1 auto;
    display: flex;
}

.measuring-page-graph.multi canvas {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    display: block;
}


.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.mini-chart .chart-container {
    height: 100%;
}

.measuring-page-graph.multi .charts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: 1fr;
    gap: 12px;
    height: calc(100vh - 120px);
    align-items: stretch;
}

.measuring-page-graph.multi .mini-chart {
    min-width: 0;
    display: flex;
}

.measuring-page-graph.multi .mini-chart .chart-container {
    width: 100%;
    height: 100%;
}

.measuring-page-graph .chart-container {
    position: relative;
    width: 100%;
    height: calc(100vh - 120px);
    overflow: hidden;
}

.measuring-page-graph canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.measuring-page-graph.multi .charts-grid,
.measuring-page-graph.multi .mini-chart,
.measuring-page-graph.multi .mini-chart .chart-container {
    min-height: 0;
}

.measuring-page-graph.multi .mini-chart {
    display: flex;
    overflow: hidden;
}

.measuring-page-graph.multi .charts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1.1fr));
    grid-template-rows: 1fr;
    gap: 6px;
    height: calc(100vh - 120px);
    align-items: stretch;
}

.measuring-page-graph.multi canvas {
    height: 100%;
}

.page.is-measuring .sidebar {
    padding-top: 0 !important;
}

.page.is-measuring .sidebar .top-row {
    display: flex !important;
    align-items: center;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 1;
    padding-bottom: 100px;
}

.page.is-measuring .sidebar .top-row .container-fluid {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.page.is-measuring .sidebar .top-row .bi,
.page.is-measuring .sidebar .top-row .oi {
    position: static;
    top: 0;
    margin-top: 0;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: .5rem;
    height: 100%;
}

.mini-chart {
    min-height: 28vh;
}

.chart-container {
    height: 60vh;
    padding-bottom: 6px;
}

.device-row-bottom {
    display: flex;
    align-items: baseline;
    padding-right: 8px;
    font-size: 12px;
}

.device-name-bottom {
    display: inline-block;
    margin-right: 4px;
}

.device-serial-bottom {
    flex: 1;
    padding-right: 8px;
    margin-left: 4px;
}

.information-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.1;
    padding: 8px 16px !important;
    width: 180px;
}

.information-btn .bi {
    line-height: 1;
    display: inline-block;
}

.information-btn.btn-white {
    background-color: #fff !important;
    border: 1px solid #0072C6 !important;
    color: #000 !important;
}

.information-btn[aria-pressed="true"],
.information-btn.btn-primary {
    background-color: #0072C6 !important;
    border-color: #0072C6 !important;
    color: #fff !important;
}

.channel.is-clickable {
    cursor: pointer;
}

.channel.is-inactive,
.channel.is-inactive .measurment-type,
.channel.is-inactive .measurment-value,
.channel.is-inactive .measurment-unit {
    color: #6b7280 !important;
}

.channel.is-inactive {
    background: #f7f7f7 !important;
    border-color: #e2e2e2 !important;
}

.export-field {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    margin-bottom: 16px;
    border-radius: 10px;
    background-color: #e6e6e6;
    padding: 8px;
    align-items: center;
    height: 100px;
}

/* ===== Config: graph scales 2-koloms layout ===== */

.scale-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 6px;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .scale-config-grid {
        grid-template-columns: 1fr;
    }
}

.scale-config-item {
    /*    padding: 4px 0 10px;
    border-bottom: 1px solid #E5E5E5;*/
}

.scale-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}

.scale-config-title {
    font-size: 0.95rem;
}

.scale-config-reverse {
    white-space: nowrap;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.scale-config-values {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 4px;
}

.scale-config-values .dual-range__unit {
    margin-left: 4px;
}

.scale-config-item .dual-range__header {
    display: none;
}

.scale-config-item .dual-range__track {
    width: 100%;
}

.scale-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
}

.scale-config-row .dual-range {
    flex: 1 1 auto;
}

.scale-config-reverse {
    margin-left: auto;
    white-space: nowrap;
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}

.dual-range__header {
    display: flex;
    align-items: baseline;
    column-gap: .5rem;
}

.dual-range__label {
    margin-right: .25rem;
}

.dual-range__values {
    display: flex;
    align-items: baseline;
    column-gap: .25rem;
}

.error-dialog {
    background: #ffffff;
    border-radius: 16px;
    min-width: 480px;
    max-width: 640px;
    padding: 0 40px 32px 40px;
    text-align: center;
}

.error-header {
    background: #e60000;
    color: #ffffff;
    border-radius: 16px 16px 0 0;
    margin: -24px -40px 24px -40px;
    padding: 8px 16px 8px 16px;
}

.error-code {
    font-size: 26px;
    font-weight: 700;
}

.error-text {
    font-size: 12px;
    margin-top: 4px;
}

.error-separator {
    height: 2px;
    width: 100%;
    background: #d0d0d0;
    margin: 0 0 24px 0;
}

.error-message p {
    margin: 0 0 32px 0;
    font-size: 12px;
    color: #333333;
}

.error-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.btn-error-primary {
    min-width: 180px;
    height: 36px;
    border-radius: 18px;
    border: none;
    padding: 0 24px;
    font-weight: 600;
    background: #ff0000;
    color: #ffffff;
    cursor: pointer;
}

.btn-error-secondary {
    min-width: 180px;
    height: 36px;
    border-radius: 18px;
    border: 2px solid #ff0000;
    background: #ffffff;
    color: #ff0000;
    font-weight: 600;
    cursor: pointer;
}

.btn-error-primary:hover {
    filter: brightness(0.9);
}

.btn-error-secondary:hover {
    background: #ffeaea;
}

.modal-body {
    padding: 0 !important;
    overflow: visible !important;
}

.modal-content {
    border-radius: 16px !important;
    overflow: hidden !important;
}

.modal-header {
    display: none !important;
}

.logout-disabled,
.measure-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.ld-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.ld-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(0, 114, 198, 0.25);
    border-top-color: var(--mainBlue, #0072C6);
    display: inline-block;
    vertical-align: middle;
    flex: 0 0 16px;
    animation: ld-spin 0.8s linear infinite;
}

@keyframes ld-spin {
    to {
        transform: rotate(360deg);
    }
}

.ld-text {
    line-height: inherit;
}


button:disabled {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
}

.ld-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    white-space: nowrap;
}

.ld-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
}

.required {
    color: #d32f2f;
    font-weight: 600;
    margin-left: 2px;
}

.form-scroll {
    padding-top: 6px;
    padding-bottom: 6px !important;
}

.scale-config-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: .75rem;
    padding: 8px 12px;
    border: 1px solid #D0D0D0;
    border-radius: 10px;
    border-left: 10px solid var(--ch-color, #0072C6);
}

/* ===== Canonieke layout voor 4 charts ===== */
.measuring-page-graph.multi .charts-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    gap: 12px;
    height: calc(100vh - 120px);
    align-items: stretch;
}

.measuring-page-graph.multi .mini-chart {
    min-width: 0;
    min-height: 0;
    display: flex;
}

.measuring-page-graph.multi .mini-chart .chart-container {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    height: 100% !important;
    width: 100% !important;
}

.measuring-page-graph .chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.measuring-page-graph canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.measuring-page-graph.multi .mini-chart>div {
    width: 100% !important;
    min-width: 0;
    flex: 1 1 auto;
}

.measuring-page-channels {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100vh;
    overflow: hidden;
}

.channels-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 8px;
}

.channels-scroll>.channels {
    overflow-y: visible;
    flex: 0 0 auto;
}

.meta-sticky {
    flex: 0 0 auto;
    position: sticky;
    bottom: 56px;
    z-index: 2;
    background: #F1F1F1;
    padding-top: 8px;
}

.config-sticky {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: #F1F1F1;
    padding: 12px 0 16px;
    border-top: 1px solid #D0D0D0;
    display: flex;
    justify-content: center;
}

.meta-axis-toggle {
    min-width: 120px;
    padding: 4px 10px;
    font-size: 0.85rem;
}

.meta-axis-toggle.is-depth {
    border-color: #0d63b5 !important;
    color: #0d63b5 !important;
}

.meta-axis-toggle.is-time {
    border-color: #ffcc00 !important;
    color: #000000 !important;
    background-color: #ffcc00 !important;
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.25);
}

.meta-axis-toggle:disabled {
    opacity: 1 !important;
    cursor: default;
}

.dual-range {
    width: 100%;
}

.dual-range__track {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.dual-range__base {
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 999px;
    background: #e2e2e2;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.dual-range__range {
    position: absolute;
    height: 6px;
    border-radius: 999px;
    background: var(--mainBlue, #0072C6);
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.dual-range__input {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    height: 28px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 3;
}

.dual-range__input::-webkit-slider-runnable-track {
    height: 6px;
    background: transparent;
    border: none;
}

.dual-range__input::-moz-range-track {
    height: 6px;
    background: transparent;
    border: none;
}

/* Thumb */
.dual-range__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--mainBlue, #0072C6);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    margin-top: -5px;
}

.dual-range__input::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--mainBlue, #0072C6);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

.dual-range__input--min {
    z-index: 3;
}

.dual-range__input--max {
    z-index: 4;
}

/* ===== Test detail: nicer layout ===== */

.test-detail-card {
    gap: 10px;
}

/* Header: volledige breedte underline */
.td-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    padding-bottom: 10px;
    margin-bottom: 12px;
}

.td-header-left {
    flex: 1 1 auto;
    /* <-- dit zorgt dat de lijn full width logisch voelt */
    min-width: 0;
    width: 100%;
    border-bottom: 1px solid #0072C6;
}

.td-title {
    margin: 0;
    padding: 0;
    border: none;
    /* voorkom dat top-line nog iets doet */
}

/* Export panel rechts: mooier + consistent */
.td-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.td-export-panel {
    border-radius: 10px;
    background: #fff;
    padding: 10px 10px 12px 10px;
    min-width: 240px;
}

.td-export-title {
    font-weight: 700;
    margin-bottom: 8px;
    color: #111;
}

/* Dit maakt van de buttons een nette 2x2 grid */
.td-export-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* Style alle knoppen die binnen ExportButtons gerenderd worden */
.td-export-grid .btn,
.td-export-grid button {
    height: 40px;
    border-radius: 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

/* Als ExportButtons jouw 'btn-white' gebruikt: net iets strakker */
.td-export-grid .btn-white {
    background: #fff !important;
    border: 1px solid #0072C6 !important;
}

.td-export-grid .btn-white:hover {
    background: #0072C6 !important;
    color: #fff !important;
}


.td-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(340px, 1fr));
    gap: 16px;
    padding-top: 10px;
    align-items: start;
}

@media (max-width: 980px) {
    .td-grid {
        grid-template-columns: 1fr;
    }
}


.td-panel {
    /*    border: 1px solid #0078d7;*/
    border-radius: 10px;
    background: #fff;
    padding: 12px 14px;
}

.td-panel-title {
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid #0078d7;
    margin-bottom: 10px;
}

.td-kv {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 12px;
    align-items: start;
}

.td-kv .k {
    color: #555;
    font-weight: 600;
}

.td-kv .v {
    color: #111;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.td-divider {
    height: 1px;
    background: #e6e6e6;
    margin: 12px 0;
}

.td-notes {
    white-space: pre-wrap;
    background: #f7f7f7;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 10px 12px;
    color: #111;
}

.td-footer {
    margin-top: 10px;
}

.test-detail-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - 110px);
    max-height: calc(100vh - 110px);
}

.test-detail-card .td-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-bottom: 12px;
}

.test-detail-card .td-footer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 10px;
    padding-bottom: 16px;
    border-top: 1px solid #0072C6;
}

.test-detail-card .page-container {
    padding-bottom: 0 !important;
}


.measuring-title-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 40px;
}

.measuring-title {
    margin: 0;
    text-align: right;
}

.simulation-modal-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.simulation-modal-card__header h4 {
    margin: 0;
}

.simulation-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    color: #333;
}

.simulation-modal-close:hover {
    color: #000;
}

.device-list {
    position: fixed;
    left: 250px;
    right: 0;
    bottom: 2px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0px 0px;
    pointer-events: none;
    z-index: 20;
}

.page.is-measuring .device-list {
    left: var(--sidebar-collapsed);
    right: clamp(150px, 11vw, 210px);
}

@media (max-width: 640px) {
    .device-list {
        left: 0;
    }
}


.measuring-page-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.measuring-page {
    flex: 1 1 auto;
    min-height: 0;
}

.measuring-device-list {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 6px 0 0 0;
    margin-top: 4px;
    border-top: none;
    background: transparent;
    min-height: auto;
    flex-wrap: wrap;
}

.form-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-section {
    border: 1px solid #D0D0D0;
    border-radius: 10px;
    background: #fff;
}

.form-section__summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px 14px 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    background: linear-gradient(to right, rgba(0, 114, 198, 0.06), #fff);
    position: relative;
    overflow: hidden;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.form-section__summary::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: #0072C6;
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.form-section__summary::-webkit-details-marker {
    display: none;
}

.form-section__summary::after {
    content: "▸";
    font-size: 18px;
    color: #0072C6;
    transition: transform 0.15s ease;
}

.form-section[open]>.form-section__summary::before {
    border-bottom-left-radius: 0;
}

.form-section__content {
    padding: 16px;
    border-top: 1px solid #E5E5E5;
}

.form-devider {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 16px 24px;
}

@media (max-width: 900px) {
    .form-devider {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px !important;
}

@media (max-width: 700px) {
    .form-group {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.form-section .form-group:last-child {
    margin-bottom: 0 !important;
}

.zero-page-card {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.zero-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.zero-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    padding-right: 8px;
}

.zeroes-table {
    margin-bottom: 0;
}

.status-bar {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 12px;
    padding-bottom: 8px;
    z-index: 2;
}

h2 {
    font-size: 1.5rem;
}

.dialog-header h2 {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
}