:root {
    --accent: #00ff66;
    --bg: #000000;
    --panel: #050505;
}

.lab-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.lab-header h1 {
    margin: 0;
}

.lab-status-box {
    margin-left: auto;
    border: 1px solid var(--accent);
    padding: 6px 10px;
}

.operator-grid {
    display: grid;
    grid-template-columns: minmax(320px, 2fr) minmax(260px, 1fr);
    gap: 12px;
    align-items: start;
}

@media (max-width: 900px) {
    .operator-grid {
        grid-template-columns: 1fr;
    }
}

.vision-video-shell {
    position: relative;
    border: 1px solid var(--accent);
    background: #050505;
    padding: 8px;
    min-height: 260px;
}

.vision-video-shell img {
    display: block;
    width: 100%;
    border: 1px solid var(--accent);
    background: #111;
}

.overlay-canvas {
    position: absolute;
    left: 8px;
    top: 8px;
    pointer-events: none;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.panel {
    border: 1px solid var(--accent);
    padding: 10px;
    background: var(--panel);
    white-space: pre-wrap;
    overflow: auto;
    max-height: 320px;
}

.button-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(520px, 1.5fr) minmax(420px, 1fr);
    gap: 14px;
    align-items: start;
}

.main-video-area {
    min-width: 0;
}

.side-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stream-footer {
    border: 1px solid var(--accent);
    border-top: none;
    padding: 10px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 12px;
    background: #050505;
}

.log-panel {
    margin-top: 16px;
    border: 1px solid var(--accent);
    background: #050505;
    padding: 10px;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#logOutput {
    height: 140px;
    overflow-y: auto;
    color: #00ff66;
    background: #000;
    border-top: 1px solid #00ff66;
    padding: 10px;
    white-space: pre-wrap;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .side-panels {
        grid-template-columns: 1fr;
    }
}

.controls-panel {
    min-height: 110px;
    max-height: 150px;
}

.detections-panel {
    min-height: 210px;
    max-height: 260px;
}

.detection-list {
    font-size: 14px;
    line-height: 1.4;
    overflow-y: auto;
    max-height: 190px;
}

.detection-row {
    display: grid;
    grid-template-columns: 90px 1fr 70px;
    gap: 8px;
    border-bottom: 1px dotted #00ff66;
    padding: 3px 0;
}

.plugin-state-panel { order: 1; }
.runtime-panel { order: 2; }
.model-panel { order: 3; }
.controls-panel { order: 4; }
.quick-info-panel { order: 5; }
.detections-panel { order: 6; }

.controls-panel {
    min-height: 110px !important;
    max-height: 150px !important;
    overflow: hidden !important;
}

.detections-panel {
    min-height: 210px;
}

.side-panels {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
        "model runtime"
        "model controls"
        "quick detections" !important;
    align-items: start !important;
}

.plugin-state-panel { grid-area: plugin !important; }
.runtime-panel { grid-area: runtime !important; }
.model-panel { grid-area: model !important; }
.controls-panel { grid-area: controls !important; }
.quick-info-panel { grid-area: quick !important; }
.detections-panel { grid-area: detections !important; }

.controls-panel {
    min-height: 120px !important;
    max-height: 150px !important;
    overflow: hidden !important;
}

.detections-panel {
    min-height: 220px !important;
}

.stream-placeholder {
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-text {
    color: #00ff66;
    font-family: monospace;
    white-space: pre-wrap;
    text-align: left;
    padding: 20px;
}

.top-dashboard-panels {
    display: grid;
    grid-template-columns: repeat(6, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.dual-stream-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
}

@media (max-width: 1400px) {
    .top-dashboard-panels {
        grid-template-columns: repeat(3, 1fr);
    }

    .dual-stream-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .top-dashboard-panels {
        grid-template-columns: 1fr;
    }
}

/* Stable Hailo Detection dual-stream layout */
.top-dashboard-panels {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 18px !important;
    align-items: stretch !important;
}

.top-dashboard-panels > .panel {
    min-height: 180px !important;
    max-height: 240px !important;
    overflow: auto !important;
}

.dual-stream-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 14px !important;
    margin-top: 18px !important;
}

.dual-stream-grid .vision-video-shell {
    min-height: 420px !important;
}

.dual-stream-grid img {
    width: 100% !important;
    height: auto !important;
}

@media (max-width: 1400px) {
    .top-dashboard-panels {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 900px) {
    .top-dashboard-panels,
    .dual-stream-grid {
        grid-template-columns: 1fr !important;
    }
}

.log-panel {
    min-height: 520px !important;
}

#logOutput {
    min-height: 440px !important;
    max-height: 440px !important;
    overflow-y: auto !important;
}

.runtime-panel {
    min-height: 300px !important;
}

.runtime-panel .metrics-grid,
.runtime-panel pre,
.runtime-panel .panel-content {
    overflow: visible !important;
}

.top-temp-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 18px;
    color: #00ff66;
    font-size: 20px;
    font-family: monospace;
    letter-spacing: 1px;
    text-shadow: 0 0 8px #00ff66;
}

.lab-header {
    position: relative;
}

.top-temp-display {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #00ff66;
    font-size: 18px;
    font-family: monospace;
    top: 6px;
}

/* Depth UI cleanup: Plugin State removed, Model & Pipeline taller */
.model-panel {
    min-height: 620px !important;
    grid-area: model !important;
}


/* Depth layout: move Model & Pipeline into old Plugin State position */
.side-grid {
    grid-template-areas:
        "model metrics"
        "model controls" !important;
}

/* Make Model & Pipeline occupy upper-left and span downward */
.model-panel {
    grid-area: model !important;
    min-height: 620px !important;
}

/* Runtime Metrics stays upper-right */
.metrics-panel {
    grid-area: metrics !important;
}

/* Controls stays lower-right */
.controls-panel {
    grid-area: controls !important;
}


/* FINAL depth layout fix */
.plugin-state-panel {
    display: none !important;
}

.model-panel {
    grid-area: model !important;
    min-height: 620px !important;
}

.side-panels {
    grid-template-areas:
        "model runtime"
        "model controls"
        "quick detections" !important;
}

/* =========================================
   Unified Vision Plugin Layout
   ========================================= */

.plugin-state-panel {
    display: none !important;
}

.side-panels {
    grid-template-areas:
        "model runtime"
        "model controls"
        "quick detections" !important;
}

.model-panel {
    grid-area: model !important;
    min-height: 620px !important;
}

.runtime-panel {
    grid-area: runtime !important;
}

.controls-panel {
    grid-area: controls !important;
}

.quick-info-panel {
    grid-area: quick !important;
}

.detections-panel {
    grid-area: detections !important;
}
