﻿/*
 * Common dashboard stylesheet.
 * Consolidated from the previous asset CSS files on 2026-08-02.
 * Active stylesheet for all dashboard pages.
 */

/* ===== responsive.css ===== */
/* Shared responsive foundation for every SCADA screen. */
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; max-width: 100%; min-height: 100%; overflow-x: hidden; }
img, video { max-width: 100%; height: auto; }
canvas { max-width: 100% !important; }
main { min-width: 0; }
main > * { min-width: 0; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
.overflow-x-auto, .table-hscroll, [id$="TableScroll"] { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }

@media (max-width: 767px) {
    body { font-size: 14px; }
    main, main.md\:ml-64, main.md\:ml-16 { margin-left: 0 !important; width: 100% !important; max-width: 100% !important; }
    #sidebar { width: min(18rem, 88vw) !important; max-width: 88vw; }
    #sidebar:not(.-translate-x-full) { transform: translateX(0) !important; }
    main > header, body > nav > div > div { min-height: 3.5rem; gap: .65rem; }
    main > header { padding: .75rem !important; flex-wrap: wrap; }
    main > header > div { min-width: 0; }
    main > header h1, main > header h2 { font-size: 1rem !important; line-height: 1.25 !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    main > header p { font-size: .7rem !important; }
    main > div[class*="p-4"], main > div[class*="p-6"] { padding: .75rem !important; gap: .85rem !important; }
    .grid.grid-cols-3 { grid-template-columns: minmax(0, 1fr) !important; }
    #inv_summary_cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    #inverterGrid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .grid.grid-cols-8 { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
    .report-table th, .report-table td { white-space: nowrap; }
    .table-hscroll { width: 100%; max-width: calc(100vw - 1.5rem); }
    #printableReport { padding: .75rem !important; }
    #printableReport .grid.grid-cols-3 { gap: .5rem !important; }
    #stringModal, [id$="-modal"] { padding: .5rem !important; align-items: flex-end !important; }
    #stringModal > div, [id$="-modal"] > div { max-height: 92dvh !important; border-radius: 1rem 1rem 0 0 !important; }
    input, select, button { min-height: 2.5rem; }
    svg[style*="min-width"] { max-width: none !important; }
    .h-\[220px\], .h-\[300px\] { min-height: 220px; }
    body > nav .h-14 { height: auto !important; min-height: 3.5rem; padding: .5rem 0; flex-wrap: wrap; }
    body > nav h1 { font-size: 1rem !important; }
    body > nav .flex.items-center.gap-3 { gap: .4rem !important; flex-wrap: wrap; justify-content: flex-end; }
    body > nav button, body > nav a { padding: .45rem .6rem !important; }
}

@media (max-width: 479px) {
    #inv_summary_cards { grid-template-columns: minmax(0, 1fr) !important; }
    #inverterGrid { grid-template-columns: minmax(0, 1fr) !important; }
    .grid.grid-cols-8 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    main > header .flex.items-center.gap-2 { gap: .35rem !important; }
    main > header button, main > header a { padding-left: .6rem !important; padding-right: .6rem !important; }
    .report-table th { font-size: 11px !important; }
    .report-table td { font-size: 12px !important; }
}

@media (min-width: 768px) and (max-width: 1100px) {
    main.md\:ml-64 { min-width: 0; }
    main > div[class*="max-w-"] { padding-left: 1rem !important; padding-right: 1rem !important; }
    .report-table th, .report-table td { white-space: nowrap; }
}

@media (orientation: landscape) and (max-height: 560px) {
    #sidebar nav { padding-top: .5rem !important; padding-bottom: .5rem !important; }
    #sidebar .nav-item { padding-top: .4rem !important; padding-bottom: .4rem !important; }
    #stringModal > div, [id$="-modal"] > div { max-height: 96dvh !important; }
}

/* ===== plant_ui_refinements.css ===== */
/* Shared plant-theme refinements: medium-soft accents, black text, neutral surfaces. */
body[data-plant-theme="violet"] {
    --plant-main: #6d28d9;
    --plant-header-bg: #c9b9f4;
    --plant-border: #aa91e4;
}
body[data-plant-theme="emerald"] {
    --plant-main: #047857;
    --plant-header-bg: #82d3ad;
    --plant-border: #54b98a;
}
body[data-plant-theme="blue"] {
    --plant-main: #1d4ed8;
    --plant-header-bg: #98bff0;
    --plant-border: #6a9fdf;
}
body[data-plant-theme="orange"] {
    --plant-main: #ea580c;
    --plant-header-bg: #fdba74;
    --plant-border: #fb923c;
}

body[data-plant-theme] table thead,
body[data-plant-theme] .plant-table-heading,
body[data-plant-theme] .bg-emerald-700 {
    background: var(--plant-header-bg) !important;
    border-color: var(--plant-border) !important;
    color: #111827 !important;
}
body[data-plant-theme] table thead th,
body[data-plant-theme] .plant-table-heading * {
    color: #111827 !important;
}

/* Overview: force Plant Overview left + Plant Information right, Inverters below. */
body:has(#vcb_time):has(#inverterGrid) main > div.p-4,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 330px !important;
    gap: 18px !important;
    align-items: start !important;
}

body:has(#vcb_time):has(#inverterGrid) #vcb_time {
    scroll-margin-top: 120px;
}

body:has(#vcb_time):has(#inverterGrid) #vcb_time.closest-guard {
    display: initial;
}

/* The first white card in overview is the Plant Overview table. */
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .bg-white:first-of-type,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .bg-white:first-of-type {
    grid-column: 1 / 2 !important;
    grid-row: 1 !important;
    width: 100% !important;
    margin: 0 !important;
    align-self: stretch !important;
}

body:has(#vcb_time):has(#inverterGrid) .overview-inverter-row,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 {
    display: contents !important;
}

body:has(#vcb_time):has(#inverterGrid) .overview-inverter-panel,
body:has(#vcb_time):has(#inverterGrid) #inverterGrid.closest-guard,
body:has(#vcb_time):has(#inverterGrid) #inverterGrid {
    min-width: 0;
}

body:has(#vcb_time):has(#inverterGrid) #inverterGrid {
    width: 100%;
}

body:has(#vcb_time):has(#inverterGrid) #inverterGrid:before {
    content: none !important;
}

body:has(#vcb_time):has(#inverterGrid) #inverterGrid:not(.x) {
    grid-column: auto;
}

body:has(#vcb_time):has(#inverterGrid) .overview-inverter-panel,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:first-child,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:first-child {
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    margin: 0 !important;
}

body:has(#vcb_time):has(#inverterGrid) .overview-plant-info-card,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2),
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) {
    grid-column: 2 / 3 !important;
    grid-row: 1 !important;
    width: 100% !important;
    max-width: 330px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--plant-border) !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.09) !important;
    background: #fff !important;
    overflow: hidden !important;
    justify-self: stretch !important;
    align-self: stretch !important;
}

.overview-table-info-row {
    display: contents !important;
}

.overview-table-info-row > .bg-white:not(.overview-plant-info-card) {
    margin: 0 !important;
    height: 100% !important;
}

.overview-plant-info-card > h3,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) > h3,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) > h3 {
    margin: 0 !important;
    padding: 13px 16px !important;
    background: var(--plant-header-bg) !important;
    border-bottom: 1px solid var(--plant-border) !important;
    color: #111827 !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: .055em !important;
    text-transform: uppercase;
}

.overview-plant-info-card > div,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) > div,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) > div {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
    align-items: stretch !important;
}

.overview-plant-info-card .flex.justify-between,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between {
    display: grid !important;
    grid-template-columns: 96px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    min-height: 42px !important;
    padding: 10px 14px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
}

.overview-plant-info-card .flex.justify-between:first-child,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between:first-child,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between:first-child {
    min-height: 62px !important;
    background: #f8fafc !important;
}

.overview-plant-info-card .flex.justify-between:last-child,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between:last-child,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between:last-child {
    border-bottom: 0 !important;
}

.overview-plant-info-card .flex.justify-between > :first-child,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between > :first-child,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between > :first-child {
    color: #64748b !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    letter-spacing: .07em !important;
    line-height: 1.1 !important;
    text-transform: uppercase;
}

.overview-plant-info-card .flex.justify-between > :last-child,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between > :last-child,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between > :last-child {
    max-width: 100% !important;
    min-width: 0 !important;
    color: #111827 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    text-align: right !important;
    overflow-wrap: anywhere;
}

.overview-plant-info-card .flex.justify-between:first-child > :last-child,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between:first-child > :last-child,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between:first-child > :last-child {
    font-size: 13px !important;
    font-weight: 900 !important;
}

.overview-plant-info-card #plantStatusBadge {
    display: inline-flex !important;
    justify-self: end !important;
    align-items: center !important;
    padding: 4px 10px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 999px !important;
    background: #f8fafc !important;
    font-size: 11px !important;
}

body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-1,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-1,
body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-2,
body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-2 {
    grid-column: 1 / -1 !important;
}

@media (max-width: 1180px) {
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4,
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 {
        grid-template-columns: 1fr !important;
    }
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .bg-white:first-of-type,
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .bg-white:first-of-type,
    body:has(#vcb_time):has(#inverterGrid) .overview-plant-info-card,
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2),
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2),
    body:has(#vcb_time):has(#inverterGrid) .overview-inverter-panel,
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:first-child,
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:first-child {
        grid-column: 1 / -1 !important;
        max-width: none !important;
    }
    .overview-plant-info-card > div,
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) > div,
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) > div {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
    .overview-plant-info-card .flex.justify-between,
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between,
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between {
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        min-height: 72px !important;
        border-bottom: 0 !important;
        border-right: 1px solid #e5e7eb !important;
        text-align: left !important;
    }
    .overview-plant-info-card .flex.justify-between > :last-child,
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between > :last-child,
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) .flex.justify-between > :last-child {
        text-align: left !important;
    }
}

@media (max-width: 760px) {
    .overview-plant-info-card > div,
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) > div,
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) > div {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 480px) {
    .overview-plant-info-card > div,
    body:has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12 > .bg-white:nth-child(2) > div,
    body:has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 > .bg-white:nth-child(2) > div {
        grid-template-columns: 1fr !important;
    }
}

/* New production Overview panel: keep the combined Plant Overview + Plant Information block unified. */
body:has(.overview-production-box):has(#vcb_time):has(#inverterGrid) main > div.p-4,
body:has(.overview-production-box):has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    align-items: stretch !important;
    grid-template-columns: none !important;
}

body:has(.overview-production-box):has(#vcb_time):has(#inverterGrid) main > div.p-4 > .overview-production-box,
body:has(.overview-production-box):has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .overview-production-box {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 20px 0 !important;
    border: 1px solid #dbe4ee !important;
    border-radius: 8px !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.07) !important;
}

body:has(.overview-production-box):has(#vcb_time):has(#inverterGrid) main > div.p-4 > .grid.grid-cols-12,
body:has(.overview-production-box):has(#vcb_time):has(#inverterGrid) main > div.sm\:p-6 > .grid.grid-cols-12 {
    display: block !important;
    width: 100% !important;
    margin: 0 0 16px 0 !important;
}

/* ===== overview_inverter_ui.css ===== */
/* Overview inverter cards and plant information layout. */
.overview-inverter-row {
    display: block !important;
    margin-bottom: 16px !important;
}

.overview-inverter-panel {
    width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
}

.overview-plant-info-card {
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 16px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .06) !important;
    background: #fff !important;
}

.overview-plant-info-card > h3 {
    margin: 0 !important;
    padding: 11px 16px !important;
    border: 0 !important;
    background: var(--plant-header-bg, #d1fae5) !important;
    color: #111827 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    letter-spacing: .05em !important;
    text-transform: uppercase;
}

.overview-plant-info-card > div {
    margin: 0 !important;
    padding: 12px 16px !important;
    display: grid !important;
    grid-template-columns: 1.7fr .8fr .9fr 1fr .75fr !important;
    gap: 12px !important;
    align-items: stretch !important;
}

.overview-plant-info-card .flex.justify-between {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 5px !important;
    min-height: 62px;
    padding: 10px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px;
    background: #f8fafc;
}

.overview-plant-info-card .flex.justify-between > :first-child {
    color: #64748b !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.overview-plant-info-card .flex.justify-between > :last-child {
    max-width: 100% !important;
    min-width: 0;
    text-align: left !important;
    color: #111827 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.overview-plant-info-card #plantStatusBadge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

#inverterGrid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: 12px !important;
}

#inverterGrid > div:not(.col-span-full) {
    min-height: 132px !important;
    border-radius: 14px !important;
    padding: 14px !important;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10) !important;
    border: 1px solid rgba(255, 255, 255, 0.30);
    transform: translateZ(0);
}

#inverterGrid > div:not(.col-span-full)::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,.16), transparent 50%);
    pointer-events: none;
    z-index: -1;
}

#inverterGrid > div:not(.col-span-full):hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16) !important;
}

#inverterGrid > div:not(.col-span-full) > button {
    top: 12px !important;
    right: 12px !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    backdrop-filter: blur(4px);
}

#inverterGrid > div:not(.col-span-full) > p:first-of-type {
    text-align: left !important;
    padding: 0 38px 0 0 !important;
    font-size: 11px !important;
    line-height: 1.25rem !important;
    letter-spacing: .08em !important;
    opacity: .92;
}

#inverterGrid > div:not(.col-span-full) > p:nth-of-type(2) {
    margin-top: 16px !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 5px !important;
    min-width: 0;
    white-space: nowrap !important;
    text-align: left !important;
    line-height: 1 !important;
}

#inverterGrid .overview-power-value {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(20px, 1.65vw, 25px) !important;
    font-weight: 900;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}

#inverterGrid .overview-power-unit {
    flex: 0 0 auto;
    font-size: 10px !important;
    font-weight: 800;
    opacity: .84;
}

#inverterGrid > div:not(.col-span-full) > div:last-child {
    position: absolute !important;
    left: 14px !important;
    right: 14px !important;
    bottom: 12px !important;
    padding-top: 9px !important;
    border-top-color: rgba(255,255,255,.25) !important;
    text-align: left !important;
}

#inverterGrid > div:not(.col-span-full) > div:last-child::before {
    content: "Today generation";
    display: block;
    margin-bottom: 2px;
    font-size: 9px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .68;
}

#inverterGrid > div:not(.col-span-full) > div:last-child p {
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .overview-plant-info-card > div {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 760px) {
    .overview-plant-info-card > div {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    #inverterGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
    }
    #inverterGrid > div:not(.col-span-full) {
        min-height: 124px !important;
        padding: 12px !important;
        border-radius: 12px !important;
    }
    #inverterGrid .overview-power-value { font-size: 20px !important; }
    #inverterGrid > div:not(.col-span-full) > div:last-child {
        left: 12px !important;
        right: 12px !important;
        bottom: 10px !important;
    }
}

@media (max-width: 480px) {
    .overview-plant-info-card > div {
        grid-template-columns: 1fr !important;
    }
}

/* ===== overview_compact_headers.css ===== */
/* Overview compact header refinements */
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) .forced-plant-info-card > h3,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) .overview-plant-info-card > h3,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) h3:has(+ .space-y-2) {
    margin: 0 !important;
    padding: 8px 14px !important;
    min-height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--plant-header-bg) !important;
    border-bottom: 1px solid var(--plant-border) !important;
    color: #111827 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em !important;
    text-align: center !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) .forced-plant-info-card,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) .overview-plant-info-card {
    padding: 0 !important;
    overflow: hidden !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) .forced-plant-info-card .space-y-2,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) .overview-plant-info-card .space-y-2 {
    padding: 8px 12px 10px !important;
    gap: 5px !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) .forced-plant-info-card .flex.justify-between,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) .overview-plant-info-card .flex.justify-between {
    min-height: 30px !important;
    padding: 5px 0 !important;
}

/* Compact Plant Overview table height */
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_time.closest-guard,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_power.closest-guard {
    display: initial;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_time,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_power,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_freq,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_pf,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_today,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_total {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    line-height: 1.15 !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_time.closest-guard,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_power.closest-guard {
    display: initial;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_time {
    position: static;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_time,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_power {
    font-size: 12px !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_time,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_power,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_freq,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_pf,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_today,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_total,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_time ~ td {
    height: 30px !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) #vcb_time.closest-guard {
    display: unset;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) div:has(> table #vcb_time) {
    overflow-x: auto !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) div:has(> .overflow-x-auto table #vcb_time) > .bg-emerald-700,
body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) div:has(> .overflow-x-auto table #vcb_time) > .plant-table-heading {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    min-height: 34px !important;
    line-height: 1.1 !important;
    font-size: 16px !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) table:has(#vcb_time) th {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    line-height: 1.15 !important;
}

body[data-plant-theme]:has(#vcb_time):has(#inverterGrid) table:has(#vcb_time) td {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    line-height: 1.15 !important;
}

/* The production Overview panel uses KPI tiles, not the legacy one-row table. */
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_time,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_power,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_freq,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_pf,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_today,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_total {
    height: auto !important;
    padding: 0 !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
}

body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_power,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_today,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_total,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_freq,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_pf,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid) .overview-production-box #vcb_time {
    font-size: 28px !important;
    font-weight: 900 !important;
}

body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid):has(#vcb_time) .overview-production-box #vcb_time,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid):has(#vcb_power) .overview-production-box #vcb_power,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid):has(#vcb_today) .overview-production-box #vcb_today,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid):has(#vcb_total) .overview-production-box #vcb_total,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid):has(#vcb_freq) .overview-production-box #vcb_freq,
body[data-plant-theme]:has(.overview-production-box):has(#inverterGrid):has(#vcb_pf) .overview-production-box #vcb_pf {
    font-size: 28px !important;
    font-weight: 900 !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
}
