/* Dashboard overview metrics, KPI cards, expanded cards, and view-state layouts. */

#dashboard-page-overview {
    padding-bottom: 0;
    transition: padding-bottom 0.2s ease;
}

#dashboard-page-overview.dashboard-chat-bottom-space-active {
    padding-bottom: 160px;
}

.overview-summary-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    height: 100%;
    padding: 28px 30px;
}

.overview-metric-item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    min-width: 0;
}

.dashboard-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.dashboard-icon-badge .dashboard-inline-svg {
    width: 30px;
    height: 30px;
}

.overview-metric-icon {
    width: 30px;
    height: 30px;
    display: block;
    object-fit: contain;
}

.overview-metric-body {
    min-width: 0;
}

.overview-metric-title {
    color: var(--text-color-secondary);
    font-size: var(--font-size-card-title);
    font-weight: 500;
    margin-bottom: 10px;
    white-space: nowrap;
}

.overview-metric-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.overview-metric-value {
    color: var(--edm-text-body);
    font-size: var(--font-size-card-value);
    font-weight: 500;
    line-height: 0.95;
    white-space: nowrap;
}

.overview-weather-row {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.overview-weather-details {
    color: var(--text-color-secondary);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
}

.overview-metric-unit {
    color: var(--text-color-secondary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.overview-agent-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--card-gap);
}

.dashboard-kpi-card {
    display: flex;
    min-height: 0;
    flex-direction: column;
    justify-content: center;
}

.dashboard-kpi-title {
    margin-bottom: 24px;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-kpi-item {
    min-width: 0;
    padding: 0 20px;
}

.dashboard-kpi-item:first-child {
    padding-left: 0;
}

.dashboard-kpi-item:last-child {
    padding-right: 0;
}

.dashboard-kpi-item + .dashboard-kpi-item {
    border-left: 1px solid var(--edm-outline);
}

.dashboard-kpi-label {
    margin-bottom: 24px;
}

.dashboard-kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.dashboard-kpi-value {
    white-space: nowrap;
}

.dashboard-kpi-unit,
.dashboard-kpi-detail {
    color: var(--text-color-secondary);
}

.dashboard-kpi-detail {
    margin-top: 8px;
}

@media (min-width: 1201px) {
    .dashboard-shell.dashboard-view-overview {
        height: 100%;
        display: grid;
        grid-template-columns: minmax(680px, 2fr) minmax(360px, 1fr);
        grid-template-rows: auto auto 340px minmax(240px, 1fr);
        gap: var(--card-gap);
        align-items: stretch;
    }

    .dashboard-view-overview > .dashboard-context-bar {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: 0;
    }

    .dashboard-view-overview > .dashboard-top-grid,
    .dashboard-view-overview .dashboard-overview-column,
    .dashboard-view-overview > .dashboard-pages-shell {
        display: contents;
    }

    .dashboard-view-overview #dashboard-page-overview {
        display: contents !important;
    }

    .dashboard-view-overview .dashboard-overview-column > .overview-summary-card {
        grid-column: 1;
        grid-row: 2;
    }

    .dashboard-view-overview .dashboard-expanded-layout,
    .dashboard-view-overview #dashboard-page-overview > .overview-agent-grid {
        min-height: 0;
        grid-column: 1;
        grid-row: 3;
    }

    .dashboard-view-overview .dashboard-controls-card {
        min-height: 0;
        grid-column: 2;
        grid-row: 2;
        align-self: start;
        height: auto;
    }

    .dashboard-view-overview.select-data-expanded .dashboard-controls-card {
        grid-row: 2 / 4;
        align-self: stretch;
        height: 100%;
    }

    .dashboard-view-overview .overview-agent-grid > .agent-card,
    .dashboard-view-overview .dashboard-expanded-overview > .agent-card {
        height: 100%;
    }

    .dashboard-view-overview .dashboard-kpi-card {
        grid-column: 1;
        grid-row: 4;
    }

    .dashboard-view-overview #dashboard-digital-twin {
        min-height: 0;
        grid-column: 1;
        grid-row: 2 / 5;
    }

    .dashboard-view-overview .dashboard-chat-card {
        width: 100%;
        height: 100%;
        grid-column: 2;
        grid-row: 3 / 5;
    }

    .dashboard-view-overview.select-data-expanded .dashboard-chat-card {
        grid-row: 4;
    }

    .dashboard-view-overview .dashboard-chat-history {
        flex: 1 1 auto;
    }
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card {
    overflow: hidden;
    background: var(--card-bg-agent);
    box-shadow: var(--card-shadow);
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-lime {
    border-left: 6px solid var(--edm-accent);
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-blue {
    border-left: 6px solid var(--edm-accent-blue);
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-yellow {
    border-left: 6px solid var(--edm-accent-yellow);
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-lime .dashboard-icon-badge {
    background: var(--edm-background-accent) !important;
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-blue .dashboard-icon-badge {
    background: var(--edm-background-accent-blue) !important;
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-yellow .dashboard-icon-badge {
    background: var(--edm-background-accent-yellow) !important;
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-lime .agent-pill {
    background: var(--edm-background-accent) !important;
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-blue .agent-pill {
    background: var(--edm-background-accent-blue) !important;
}

.dashboard-shell:not(.select-data-expanded) #dashboard-page-overview > .overview-agent-grid > .agent-card-yellow .agent-pill {
    background: var(--edm-background-accent-yellow) !important;
}

.dashboard-view-overview #dashboard-page-overview > .overview-agent-grid > .agent-card {
    overflow: hidden;
    background: var(--card-bg-agent);
    box-shadow: var(--card-shadow);
}

.dashboard-view-overview #dashboard-page-overview > .overview-agent-grid > .agent-card-lime {
    border-top: 6px solid var(--edm-accent);
    border-left: 0 !important;
}

.dashboard-view-overview #dashboard-page-overview > .overview-agent-grid > .agent-card-blue {
    border-top: 6px solid var(--edm-accent-blue);
    border-left: 0 !important;
}

.dashboard-view-overview #dashboard-page-overview > .overview-agent-grid > .agent-card-yellow {
    border-top: 6px solid var(--edm-accent-yellow);
    border-left: 0 !important;
}

.dashboard-view-overview .overview-agent-grid > .agent-card-lime .dashboard-icon-badge,
.dashboard-view-overview .overview-agent-grid > .agent-card-lime .agent-pill {
    background: var(--edm-background-accent) !important;
}

.dashboard-view-overview .overview-agent-grid > .agent-card-blue .dashboard-icon-badge,
.dashboard-view-overview .overview-agent-grid > .agent-card-blue .agent-pill {
    background: var(--edm-background-accent-blue) !important;
}

.dashboard-view-overview .overview-agent-grid > .agent-card-yellow .dashboard-icon-badge,
.dashboard-view-overview .overview-agent-grid > .agent-card-yellow .agent-pill {
    background: var(--edm-background-accent-yellow) !important;
}

.dashboard-view-overview .overview-agent-grid .agent-meta-row {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
}

.dashboard-view-overview .overview-agent-grid .agent-pill {
    width: 100%;
}

.dashboard-view-overview .overview-agent-grid .battery-main-row {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 24px;
}

.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-lime,
.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-blue,
.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-yellow {
    overflow: hidden;
    background: var(--card-bg-agent);
    box-shadow: var(--card-shadow);
}

.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-lime {
    border-top: 6px solid var(--edm-accent);
}

.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-blue {
    border-top: 6px solid var(--edm-accent-blue);
}

.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-yellow {
    border-top: 6px solid var(--edm-accent-yellow);
}

.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-lime .dashboard-icon-badge,
.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-lime .agent-pill {
    background: var(--edm-background-accent) !important;
}

.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-blue .dashboard-icon-badge,
.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-blue .agent-pill {
    background: var(--edm-background-accent-blue) !important;
}

.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-yellow .dashboard-icon-badge,
.dashboard-shell:not(.select-data-expanded) .dashboard-page-pane .agent-context-card > .agent-card-yellow .agent-pill {
    background: var(--edm-background-accent-yellow) !important;
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-lime,
.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-blue,
.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-yellow {
    overflow: hidden;
    background: var(--card-bg-agent);
    box-shadow: var(--card-shadow);
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-lime {
    border-top: 6px solid var(--edm-accent);
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-blue {
    border-top: 6px solid var(--edm-accent-blue);
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-yellow {
    border-top: 6px solid var(--edm-accent-yellow);
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .dashboard-expanded-agent-card {
    border-top: 0;
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout #dashboard-expanded-agent-cooling {
    border-left: 6px solid var(--edm-accent-blue);
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout #dashboard-expanded-agent-workload {
    border-left: 6px solid var(--edm-accent);
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout #dashboard-expanded-agent-ess {
    border-left: 6px solid var(--edm-accent-yellow);
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-lime .dashboard-icon-badge {
    background: var(--edm-background-accent) !important;
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-blue .dashboard-icon-badge {
    background: var(--edm-background-accent-blue) !important;
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-yellow .dashboard-icon-badge {
    background: var(--edm-background-accent-yellow) !important;
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-lime .agent-pill {
    background: var(--edm-background-accent) !important;
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-blue .agent-pill {
    background: var(--edm-background-accent-blue) !important;
}

.dashboard-shell.select-data-expanded .dashboard-expanded-layout .agent-card-yellow .agent-pill {
    background: var(--edm-background-accent-yellow) !important;
}

.overview-agent-grid .battery-main-row {
    display: block;
}
