/* EAF Electrodes Summary - AG Grid + Chart.js styles */

/* Phase grids: shorter than the full-screen grids since we have 3 of them stacked.
   The shared ag-grid-module template hardcodes `style="height: 75vh"` on its inner
   <div id="agGrid_*">, so we MUST override that inline style with !important and
   force the wrapper chain to 100% height. Otherwise the grid overflows the card. */
#grid-phase-a,
#grid-phase-b,
#grid-phase-c {
    height: 38vh;
    border: 1px solid #ccc;
    overflow: hidden;
}

#grid-phase-a > .ag-grid-module,
#grid-phase-b > .ag-grid-module,
#grid-phase-c > .ag-grid-module {
    height: 100%;
    width: 100%;
    display: block;
}

#grid-phase-a .ag-grid-module > div[id^="agGrid_"],
#grid-phase-b .ag-grid-module > div[id^="agGrid_"],
#grid-phase-c .ag-grid-module > div[id^="agGrid_"] {
    height: 100% !important;
    width: 100%;
}

.processes-grid-container .ag-theme-alpine {
    --ag-header-height: 38px;
}

.ag-theme-alpine .ag-header {
    background-color: #f8f8f8;
    border-bottom: 1px solid #babfc7;
}

/* AG Grid: centered headers (group and column) */
.ag-theme-alpine .ag-header-group-cell-label,
.ag-theme-alpine .ag-header-cell-label {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
}

.ag-theme-alpine .ag-header-cell,
.ag-theme-alpine .ag-header-group-cell {
    padding-left: 6px;
    padding-right: 6px;
    margin: 0;
}

/* AG Grid loading overlay (matches caster-production) */
.ag-theme-alpine .ag-overlay-loading-center {
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
}

/* Phase color accents (left border) — match the chart series colors */
.kpi-card.phase-a,
.phase-card.phase-a {
    border-left: 4px solid #df1717;
}
.kpi-card.phase-b,
.phase-card.phase-b {
    border-left: 4px solid #17a83a;
}
.kpi-card.phase-c,
.phase-card.phase-c {
    border-left: 4px solid #1f6fdf;
}

/* Pinned bottom row (Average row) — yellow tint, bold, like the legacy "tr.average" */
.ag-theme-alpine .ag-floating-bottom .ag-row {
    background-color: #fffbe6 !important;
    font-weight: 700 !important;
}
.ag-theme-alpine .ag-floating-bottom .ag-cell {
    color: #202124;
}

/* Heat link cell (matches eaf-electrode-events) */
.heat-link {
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
}
.heat-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* KPI tiles */
.kpi-card .kpi-value {
    line-height: 1.1;
}
.kpi-card .kpi-label {
    margin-bottom: 2px;
}
