.lab-body { background: #f8fafc; }
.lab-page { padding-top: 98px; padding-bottom: 40px; max-width: 1540px; }
.lab-breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.lab-heading, .lab-card-heading, .lab-pagination { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.lab-heading h1 { font-size: 34px; margin: 0; letter-spacing: -.8px; }
.lab-heading p, .lab-hint { color: var(--muted); margin: 4px 0 12px; font-size: 13px; }
.lab-connection { text-align: right; font-size: 13px; }
.lab-connection small { display: block; color: var(--muted); margin-top: 5px; }
.lab-connection .online { color: #167546; }
.lab-connection .offline { color: #92400e; }
.lab-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin: 20px 0; }
.lab-tabs a { padding: 10px 0; font-size: 14px; }
.lab-tabs a:first-child { border-bottom: 2px solid var(--blue); color: var(--blue); }
.lab-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(270px, 1fr); gap: 20px; }
.lab-main-column, .lab-side-column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.lab-card { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
.lab-card h2 { font-size: 17px; line-height: 1.4; margin: 0 0 16px; }
.lab-card-heading h2 { margin: 0; }
.lab-overview { padding: 0; overflow: hidden; }
.lab-photo { position: relative; height: 280px; background: #123b59; color: white; }
.lab-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 60%; }
.lab-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,rgba(5,22,43,.88),rgba(5,22,43,.05)); }
.lab-photo-copy { position: absolute; inset: 22px; z-index: 1; }
.lab-photo-copy p { margin: 38px 0 0; font-size: 13px; }
.lab-photo-copy > strong { font-size: clamp(36px,4vw,60px); font-weight: 600; line-height: 1.2; }
.lab-photo-copy strong small { font-size: 26px; }
.lab-photo-caption { position: absolute; bottom: 8px; right: 12px; z-index: 1; font-size: 10px; background: #10283ab0; padding: 2px 6px; }
.lab-metrics { display: grid; grid-template-columns: repeat(4,1fr); padding: 20px 10px; }
.lab-metrics > div { padding: 0 14px; border-right: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.lab-metrics > div:last-child { border: 0; }
.lab-metrics strong { display: block; font-size: 20px; color: var(--ink); }
.lab-chart { position: relative; height: 300px; margin-top: 18px; }
.lab-segment { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.lab-segment button { border: 0; background: white; padding: 7px 12px; cursor: pointer; font-size: 12px; color: var(--muted); }
.lab-segment button[aria-pressed=true] { background: var(--blue); color: white; }
.lab-lamp { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; gap: 15px; }
.lab-lamp small { display: block; color: var(--muted); font-size: 12px; }
.lab-switch { width: 45px; height: 25px; border-radius: 30px; background: #94a3b8; border: 0; padding: 3px; cursor: pointer; flex-shrink: 0; }
.lab-switch::before { content: ''; display: block; width: 19px; height: 19px; border-radius: 50%; background: white; transition: transform .15s; }
.lab-switch[aria-checked=true] { background: var(--blue); }
.lab-switch[aria-checked=true]::before { transform: translateX(20px); }
.lab-switch:disabled { opacity: .5; cursor: not-allowed; }
.lab-news { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.lab-news img { width: 100%; height: 125px; object-fit: cover; border-radius: 6px; }
.lab-news small { display: block; color: var(--muted); }
.lab-link { display: inline-block; margin-top: 16px; color: var(--blue); font-size: 13px; }
.lab-team { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.lab-team strong, .lab-team small { display: block; overflow-wrap: anywhere; line-height: 1.4; font-size: 12px; }
.lab-team small { color: var(--muted); margin-top: 4px; }
.lab-team img, .lab-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: #e2e8f0; margin-bottom: 8px; }
.lab-team > p { grid-column: 1/-1; }
.lab-history { margin-top: 22px; scroll-margin-top: 95px; }
#monitoring, #project-info { scroll-margin-top: 95px; }
.lab-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin: 18px 0; font-size: 13px; }
.lab-filters label { display: grid; gap: 5px; color: var(--muted); }
.lab-filters input { border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: inherit; background: white; color: var(--ink); }
.lab-filters small { color: var(--muted); align-self: center; }
.lab-button { border: 0; border-radius: 6px; background: var(--blue); color: white; padding: 9px 16px; font: inherit; font-size: 13px; cursor: pointer; }
.lab-table-scroll { overflow-x: auto; }
.lab-history table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.lab-history th { background: #f1f5f9; color: #475569; font-weight: 500; }
.lab-history td, .lab-history th { padding: 13px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lab-history tbody tr:hover { background: #f8fafc; }
.lab-state { font-size: 11px; color: var(--muted); }
.lab-state.on, .lab-state.off { display: inline-block; padding: 2px 10px; border-radius: 5px; background: #e2e8f0; color: #475569; }
.lab-state.on { color: #0865b5; background: #e0efff; }
.lab-empty { text-align: center; color: var(--muted); height: 100px; }
.lab-pagination { margin-top: 18px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.lab-pagination nav { display: flex; gap: 6px; }
.lab-pagination nav a, .lab-pagination nav span { padding: 5px 12px; border-radius: 5px; }
.lab-pagination [aria-current=page] { background: var(--blue); color: white; }
.lab-export-menu { position: relative; }
.lab-export-menu > div { position: absolute; right: 0; top: 44px; width: 225px; padding: 10px; background: white; border: 1px solid var(--line); border-radius: 8px; z-index: 5; box-shadow: 0 6px 20px #0f172a15; }
.lab-export-menu button { display: block; width: 100%; text-align: left; border: 0; padding: 10px; background: white; cursor: pointer; }
.lab-export-menu button:hover { background: #f1f5f9; }
.lab-export-menu small { display: block; font-size: 11px; color: var(--muted); padding: 8px; }
.lab-error, #export-message, #control-message, #chart-message { font-size: 13px; color: #92400e; }
@media(max-width:900px) { .lab-grid { grid-template-columns: 1fr; } .lab-side-column { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); } .lab-heading h1 { font-size: 28px; } }
@media(max-width:560px) { .lab-page { padding-top: 84px; } .lab-heading { align-items: start; flex-direction: column; gap: 8px; } .lab-connection { text-align: left; } .lab-side-column { display: flex; } .lab-metrics { grid-template-columns: 1fr 1fr; gap: 16px 0; } .lab-metrics > div:nth-child(2) { border: 0; } .lab-card { padding: 15px; } .lab-overview { padding: 0; } .lab-photo { height: 240px; } .lab-card-heading { gap: 10px; flex-wrap: wrap; } .lab-chart { height: 240px; } .lab-filters label, .lab-filters input { width: 100%; } }
@media(prefers-reduced-motion:reduce) { .lab-switch::before { transition: none; } }
.lab-heading h1 { line-height: 1.15; margin-bottom: 5px; }
.lab-heading p { margin: 0; line-height: 1.45; }
.lab-lamp { padding: 10px 0; }
.lab-heading { margin-bottom: 24px; }
.lab-export-menu > summary { display: flex; align-items: center; justify-content: center; gap: 8px; list-style: none; }
.lab-export-menu > summary::-webkit-details-marker { display: none; }
.header .dropdown > summary { display: flex; align-items: center; justify-content: center; gap: 10px; list-style: none; }
.header .dropdown > summary::-webkit-details-marker { display: none; }
.pv-charts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; margin-top:20px; }
.pv-charts .lab-chart { height:250px; }
.pv-chart { --sensor-color:var(--blue); border-top:3px solid var(--sensor-color)!important; }
.pv-chart[data-pv-color="voltage"] { --sensor-color:#168b88; }
.pv-chart[data-pv-color="current"] { --sensor-color:#a76b19; }
.pv-chart h2 { color:var(--sensor-color); }
.lab-chart { position:relative; }
.sensor-chart-empty { position:absolute; top:50%; left:0; right:0; text-align:center; transform:translateY(-50%); font-size:12px; color:var(--muted); pointer-events:none; }
.sensor-chart-empty[hidden] { display:none; }
html[data-theme="dark"] .pv-chart[data-pv-color="voltage"] { --sensor-color:#5dc8bf; }
html[data-theme="dark"] .pv-chart[data-pv-color="current"] { --sensor-color:#e8b764; }
@media(max-width:760px) { .pv-charts { grid-template-columns:1fr; } }

.pv-environment-charts{grid-template-columns:repeat(2,minmax(0,1fr))}.pv-chart[data-pv-color="light"]{--sensor-color:#8b5bb5}.pv-chart[data-pv-color="temperature"]{--sensor-color:#cb6440}html[data-theme="dark"] .pv-chart[data-pv-color="light"]{--sensor-color:#c4a3e8}html[data-theme="dark"] .pv-chart[data-pv-color="temperature"]{--sensor-color:#f5a080}@media(max-width:760px){.pv-environment-charts{grid-template-columns:1fr}}
