﻿/* BMSSMART THERMOAI LAB DASHBOARD V1 */

.thermoai-shell {
    --lab-bg: #071118;
    --lab-deck: #091821;
    --lab-panel: #0d202b;
    --lab-panel-alt: #102832;
    --lab-line: #1b3a46;
    --lab-text: #edf8fa;
    --lab-muted: #9bb1ba;
    --lab-cyan: #43d9d7;
    --lab-green: #8cde62;
    --lab-blue: #658fff;
    --lab-amber: #f5bd4e;
    grid-template-columns: 210px minmax(0, 1fr);
    min-height: 100vh;
    color: var(--lab-text);
    background-color: var(--lab-deck);
    background-image:
        linear-gradient(rgba(67, 217, 215, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(67, 217, 215, .035) 1px, transparent 1px);
    background-size: 28px 28px;
}

.thermoai-shell,
.thermoai-shell button,
.thermoai-shell input,
.thermoai-shell select {
    font-family: Inter, "Segoe UI", sans-serif;
}

.thermoai-sidebar {
    width: 210px;
    padding: 20px 14px;
    background: #061018;
    border-right-color: var(--lab-line);
}

.thermoai-brand .brand-mark {
    background: linear-gradient(135deg, var(--lab-green), var(--lab-cyan));
    color: #031114;
}

.thermoai-brand small {
    color: var(--lab-cyan) !important;
}

.thermoai-nav {
    gap: 4px;
}

.thermoai-nav .nav-item {
    width: 100%;
    min-height: 40px;
    border: 0;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.thermoai-control-lock {
    padding: 12px;
    border-color: rgba(140, 222, 98, .25);
    background: rgba(140, 222, 98, .07);
}

.thermoai-control-lock strong,
.thermoai-control-lock small {
    font-size: 12px;
}

.thermoai-workspace {
    grid-column: 2;
    min-width: 0;
}

.thermoai-topbar {
    min-height: 68px;
    padding: 10px 20px;
    background: rgba(9, 24, 33, .97);
    border-bottom-color: var(--lab-line);
}

.thermoai-topbar h1 {
    margin-top: 2px;
    font-size: 23px;
}

.thermoai-context {
    display: grid;
    grid-template-columns: .8fr .95fr 1fr 1.25fr .9fr;
    gap: 8px;
    min-height: 48px;
    padding: 7px 20px;
    background: rgba(13, 32, 43, .96);
    border-bottom: 1px solid var(--lab-line);
}

.thermoai-context > div {
    min-width: 0;
    padding-right: 9px;
    border-right: 1px solid var(--lab-line);
}

.thermoai-context > div:last-child {
    border-right: 0;
}

.thermoai-context span,
.catalog-readiness-grid span {
    display: block;
    color: var(--lab-muted);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.thermoai-context strong {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--lab-text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thermoai-context strong.awaiting,
.catalog-readiness-grid strong {
    color: var(--lab-amber);
}

.thermoai-sheetbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    min-height: 46px;
    padding: 6px 20px 0;
}

.thermoai-sheet-tabs {
    display: flex;
    gap: 4px;
}

.thermoai-sheet-tabs button {
    padding: 9px 14px;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0;
    color: var(--lab-muted);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
}

.thermoai-sheet-tabs button[aria-selected="true"] {
    color: var(--lab-text);
    border-color: var(--lab-line);
    border-bottom-color: var(--lab-cyan);
    background: var(--lab-panel);
}

.thermoai-mode {
    padding-bottom: 9px;
    color: var(--lab-amber);
    font-size: 12px;
}

.thermoai-content {
    max-width: none;
    padding: 10px 20px 20px;
}

.thermoai-sheet[hidden] {
    display: none;
}

.thermoai-live-grid {
    display: grid;
    grid-template-columns: 1.05fr 1.55fr .85fr;
    gap: 10px;
    align-items: start;
}

.thermoai-shell .panel {
    border-color: var(--lab-line);
    border-radius: 10px;
    background: rgba(13, 32, 43, .96);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .14);
}

.thermoai-shell .compact-heading {
    min-height: 48px;
    margin-bottom: 0;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--lab-line);
}

.thermoai-shell .compact-heading h3 {
    margin-top: 2px;
    font-size: 15px;
}

.thermoai-instruments,
.thermoai-plant-sheet,
.thermoai-agent-console {
    min-height: 350px;
}

.thermoai-gauge-deck {
    display: grid;
    gap: 8px;
    padding-top: 10px;
}

.thermoai-gauge {
    position: relative;
    min-height: 145px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 52%, rgba(67, 217, 215, .13), transparent 62%),
        var(--lab-panel-alt);
}

.thermoai-gauge svg {
    width: 165px;
    height: 110px;
}

.gauge-track,
.gauge-value {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}

.gauge-track {
    stroke: rgba(155, 177, 186, .18);
}

.gauge-value {
    stroke: var(--lab-cyan);
    filter: drop-shadow(0 0 5px rgba(67, 217, 215, .6));
}

.gauge-needle {
    stroke: var(--lab-green);
    stroke-width: 2.5;
    stroke-linecap: round;
    transform-origin: 85px 91px;
    transition: transform .35s ease;
}

.gauge-hub {
    fill: var(--lab-green);
}

.gauge-value-text {
    position: absolute;
    right: 0;
    bottom: 14px;
    left: 0;
    text-align: center;
}

.gauge-value-text strong {
    display: block;
    color: var(--lab-text);
    font-size: 27px;
    font-variant-numeric: tabular-nums;
}

.gauge-value-text span {
    display: block;
    color: var(--lab-cyan);
    font-size: 12px;
}

.thermoai-demand-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.thermoai-demand-pair > div,
.agent-metrics > div,
.thermoai-readiness-strip > div,
.catalog-readiness-grid > div {
    padding: 8px;
    border-radius: 7px;
    background: var(--lab-panel-alt);
}

.thermoai-demand-pair span,
.agent-metrics span,
.thermoai-readiness-strip span {
    display: block;
    color: var(--lab-muted);
    font-size: 11px;
}

.thermoai-demand-pair strong {
    display: block;
    margin: 4px 0 6px;
    font-size: 13px;
}

.thermoai-demand-pair b {
    font-size: 19px;
    font-weight: 700;
}

.demand-bar {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(155, 177, 186, .16);
}

.demand-bar em {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--lab-blue);
    transition: width .35s ease;
}

.demand-bar.proposed em {
    background: var(--lab-green);
}

.thermoai-energy-meter {
    padding: 9px;
    border: 1px solid rgba(67, 217, 215, .24);
    border-radius: 8px;
    background: linear-gradient(145deg, var(--lab-panel-alt), #07141c);
}

.energy-meter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--lab-muted);
    font-size: 11px;
}

.energy-meter-header select {
    width: auto;
    padding: 4px 7px;
    font-size: 11px;
}

.energy-display {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 7px 0 3px;
    padding: 7px 9px;
    border: 1px solid var(--lab-line);
    border-radius: 5px;
    color: var(--lab-green);
    background: #050e14;
    font-family: Consolas, monospace;
}

.energy-display strong {
    font-size: 24px;
    font-variant-numeric: tabular-nums;
}

.energy-display span {
    font-size: 12px;
}

.thermoai-energy-meter small {
    color: var(--lab-muted);
    font-size: 11px;
}

.thermoai-flow-map {
    position: relative;
    min-height: 220px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    align-items: center;
    padding: 26px 8px;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(67, 217, 215, .09), transparent 65%),
        linear-gradient(rgba(67, 217, 215, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(67, 217, 215, .045) 1px, transparent 1px);
    background-size: auto, 20px 20px, 20px 20px;
}

.flow-pipe {
    position: absolute;
    right: 11%;
    left: 11%;
    height: 2px;
}

.flow-pipe.primary {
    top: 50%;
    background: linear-gradient(90deg, var(--lab-blue), var(--lab-cyan), var(--lab-green));
    box-shadow: 0 0 8px rgba(67, 217, 215, .55);
}

.flow-pipe.return {
    top: 72%;
    border-top: 1px dashed var(--lab-muted);
    opacity: .6;
}

.flow-equipment {
    position: relative;
    z-index: 1;
    min-height: 104px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    padding: 9px 6px;
    border: 1px solid rgba(67, 217, 215, .25);
    border-radius: 8px;
    text-align: center;
    background: rgba(13, 32, 43, .96);
}

.equipment-icon {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border: 1px solid var(--lab-cyan);
    border-radius: 50%;
    color: var(--lab-cyan);
    background: rgba(67, 217, 215, .08);
    font-family: Consolas, monospace;
    font-size: 12px;
}

.flow-equipment strong {
    font-size: 12px;
}

.flow-equipment small {
    color: var(--lab-muted);
    font-size: 11px;
}

.thermoai-readiness-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding-top: 8px;
}

.thermoai-readiness-strip strong {
    display: block;
    margin-top: 3px;
    color: var(--lab-amber);
    font-size: 11px;
}

.agent-state {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
}

.agent-orbit {
    width: 55px;
    height: 55px;
    display: grid;
    place-items: center;
    border: 1px solid var(--lab-cyan);
    border-radius: 50%;
    color: var(--lab-cyan);
    background: radial-gradient(circle, rgba(67, 217, 215, .2), transparent 67%);
    box-shadow: 0 0 18px rgba(67, 217, 215, .18);
    font-family: Consolas, monospace;
}

.agent-state strong {
    display: block;
    font-size: 14px;
}

.agent-state small {
    display: block;
    margin-top: 4px;
    color: var(--lab-muted);
    font-size: 11px;
    line-height: 1.4;
}

.agent-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.agent-metrics strong {
    display: block;
    margin-top: 4px;
    color: var(--lab-text);
    font-size: 14px;
}

.agent-boundary {
    margin-top: 8px;
    padding: 9px;
    border-radius: 7px;
    color: var(--lab-amber);
    background: rgba(245, 189, 78, .08);
}

.agent-boundary strong,
.agent-boundary small {
    display: block;
    font-size: 11px;
}

.agent-boundary small {
    margin-top: 3px;
    color: var(--lab-muted);
}

.thermoai-cycle-control {
    grid-column: 1 / 2;
}

.thermoai-control-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 7px;
    align-items: end;
    padding-top: 10px;
}

.thermoai-control-form label {
    font-size: 11px;
}

.thermoai-control-form input,
.thermoai-control-form select {
    min-height: 38px;
    padding: 7px 9px;
    font-size: 12px;
}

.compact-switch {
    min-height: 38px;
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border: 1px solid var(--lab-line);
    border-radius: 7px;
}

.compact-switch input {
    width: 16px;
    min-height: auto;
}

.thermoai-control-form .primary-button {
    grid-column: 1 / -1;
    min-height: 40px;
}

.thermoai-timeline-panel {
    grid-column: 2 / 4;
}

.thermoai-timeline {
    height: 205px;
    min-height: 205px;
    padding-top: 8px;
}

.thermoai-pipeline-panel {
    grid-column: 1 / -1;
}

.thermoai-pipeline {
    gap: 5px;
    padding-top: 10px;
}

.thermoai-pipeline .workflow-step {
    min-height: 75px;
    padding: 8px 6px;
}

.thermoai-pipeline .workflow-step strong {
    font-size: 12px;
}

.thermoai-pipeline .workflow-step small {
    font-size: 11px;
}

.thermoai-analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
}

.thermoai-wide-panel {
    grid-column: 1 / -1;
}

.thermoai-rule-list,
.thermoai-analysis-grid .explanation-content,
.thermoai-analysis-grid .command-cards {
    max-height: 260px;
    overflow-y: auto;
}

.compact-table-wrap {
    max-height: 285px;
    overflow: auto;
}

.thermoai-shell table {
    font-size: 12px;
}

.thermoai-shell th,
.thermoai-shell td {
    padding: 8px 9px;
}

.thermoai-mapping-form {
    grid-template-columns: 1fr 1fr;
}

.thermoai-mapping-form label:last-of-type,
.thermoai-mapping-form button {
    align-self: end;
}

.thermoai-catalog-boundary {
    border-color: rgba(245, 189, 78, .28) !important;
}

.catalog-readiness-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    padding-top: 10px;
}

.catalog-readiness-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

@media (max-width: 1250px) {
    .thermoai-live-grid {
        grid-template-columns: 1fr 1.6fr;
    }

    .thermoai-agent-console {
        grid-column: 1 / -1;
        min-height: auto;
    }

    .thermoai-agent-console .agent-state,
    .thermoai-agent-console .agent-metrics,
    .thermoai-agent-console .agent-boundary {
        display: inline-grid;
        vertical-align: top;
    }

    .thermoai-cycle-control {
        grid-column: 1 / 2;
    }

    .thermoai-timeline-panel {
        grid-column: 2 / 3;
    }
}

@media (max-width: 900px) {
    .thermoai-shell {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .thermoai-sidebar {
        width: 72px;
        padding: 16px 10px;
    }

    .thermoai-brand > div,
    .thermoai-nav .nav-item:not(.active),
    .thermoai-nav .nav-item.active {
        font-size: 0;
    }

    .thermoai-nav .nav-item span {
        font-size: 11px;
    }

    .thermoai-control-lock {
        display: none;
    }

    .thermoai-workspace {
        grid-column: 2;
    }

    .thermoai-context {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .thermoai-live-grid,
    .thermoai-analysis-grid {
        grid-template-columns: 1fr;
    }

    .thermoai-instruments,
    .thermoai-plant-sheet,
    .thermoai-agent-console,
    .thermoai-cycle-control,
    .thermoai-timeline-panel,
    .thermoai-pipeline-panel,
    .thermoai-wide-panel {
        grid-column: 1;
    }

    .catalog-readiness-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .thermoai-shell {
        display: block;
    }

    .thermoai-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        display: flex;
        align-items: center;
        overflow-x: auto;
    }

    .thermoai-nav {
        display: flex;
        margin: 0;
    }

    .thermoai-nav .nav-item {
        width: auto;
        min-width: 45px;
    }

    .thermoai-workspace {
        margin: 0;
    }

    .thermoai-topbar,
    .thermoai-sheetbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .thermoai-context {
        grid-template-columns: 1fr 1fr;
    }

    .thermoai-sheet-tabs {
        width: 100%;
    }

    .thermoai-sheet-tabs button {
        flex: 1;
    }

    .thermoai-content {
        padding-right: 10px;
        padding-left: 10px;
    }

    .thermoai-flow-map,
    .thermoai-readiness-strip,
    .catalog-readiness-grid,
    .thermoai-control-form {
        grid-template-columns: 1fr 1fr;
    }

    .flow-pipe {
        display: none;
    }

    .thermoai-pipeline {
        grid-template-columns: 1fr 1fr;
    }

    .thermoai-pipeline .workflow-connector {
        display: none;
    }
}
