/* H11.0-P11.1-R22 — Professional Chart Engine Standard
   Apache ECharts-backed charts with executive readability and exact-value hover/touch interaction. */

.ddb-echart-host {
    width: 100%;
    min-width: 0;
    position: relative;
}

.ddb-echart-host canvas,
.ddb-echart-host svg {
    outline: none;
}

.ddb-echart-host--compare {
    height: 100%;
    min-height: 280px;
}

.ddb-echart-host--horizontal {
    min-height: 320px;
}

.ddb-echart-overlay {
    z-index: 1;
}

[data-ddb-echarts-rendered="true"] {
    --ddb-chart-engine-ready: 1;
}

.ddb-echarts-tooltip {
    display: grid;
    gap: 3px;
    min-width: 148px;
    line-height: 1.35;
}

.ddb-echarts-tooltip strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 950;
}

.ddb-echarts-tooltip span {
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 750;
}

.ddb-echarts-tooltip b {
    color: #ffffff;
    font-size: 15px;
    font-weight: 950;
}

.ddb-echarts-tooltip em {
    color: #93c5fd;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

/* Canvas fallback remains in DOM but is hidden only after successful ECharts render. */
canvas[data-ddb-echarts-rendered="true"] {
    display: none !important;
}

/* Revenue workspace */
body.page-revenue .eri-v2-chart-stage > .ddb-echart-host--compare {
    width: 100%;
    height: 100% !important;
    min-height: 100%;
}

/* Shared canvas chart containers */
.patient1010-chart-card > .ddb-echart-host,
.beds1014-chart-stage > .ddb-echart-host,
.diagnostics-chart-stage > .ddb-echart-host,
.doctors1013-chart-stage > .ddb-echart-host,
.operations-chart-stage > .ddb-echart-host,
.exec-chart-stage > .ddb-echart-host {
    width: 100%;
}

/* Donuts: keep existing center labels above professional chart layer. */
[data-ddb-chart-segments][data-ddb-echarts-rendered="true"],
.exec-leadership-donut[data-ddb-echarts-rendered="true"],
.review-status-donut[data-ddb-echarts-rendered="true"] {
    background: transparent !important;
    isolation: isolate;
}

[data-ddb-chart-segments][data-ddb-echarts-rendered="true"] > :not(.ddb-echart-host),
.exec-leadership-donut[data-ddb-echarts-rendered="true"] > :not(.ddb-echart-host),
.review-status-donut[data-ddb-echarts-rendered="true"] > :not(.ddb-echart-host) {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

/* Replaced DOM chart collections */
.ddb-echart-dom-upgrade {
    width: 100%;
    border: 0;
    border-radius: 16px;
    background: transparent;
}

.exec-leadership-capacity .ddb-echart-dom-upgrade,
.idr-v11-care-card .ddb-echart-dom-upgrade,
.review-dashboard-panel .ddb-echart-dom-upgrade,
.operations-card .ddb-echart-dom-upgrade {
    margin-top: 4px;
}

/* Exact-value tooltip fallback used for compact micro indicators. */
#ddb-chart-tooltip {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

/* Reduce height on compact cards while preserving touch targets. */
@media (max-width: 900px) {
    .ddb-echart-host--compare { min-height: 260px; }
    .ddb-echart-host--horizontal { min-height: 280px; }
}

@media (max-width: 520px) {
    .ddb-echart-host--compare { min-height: 240px; }
    .ddb-echart-host--horizontal { min-height: 260px; }
    .ddb-echarts-tooltip { min-width: 132px; }
}


/* H11.0-P11.1-R24 — Executive chart readability closure */
body.page-revenue.eri-v2-active .eri-v2-tabs {
    grid-template-columns: repeat(5, minmax(112px, 1fr));
    gap: 10px;
}
body.page-revenue.eri-v2-active .eri-v2-tab {
    min-height: 52px;
    padding: 9px 10px;
    font-size: 14px;
    line-height: 1.15;
}
.ddb-echart-host--donut { overflow: visible !important; }
@media (max-width: 900px) {
    body.page-revenue.eri-v2-active .eri-v2-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    body.page-revenue.eri-v2-active .eri-v2-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* H11.0-P11.1-R25 — Executive Smart Data Label Orchestration */
.ddb-echart-host[data-ddb-smart-labels="true"] {
    --ddb-smart-label-orchestration: 1;
}
.ddb-echart-host[data-ddb-smart-labels="true"] canvas {
    overflow: visible;
}
body.page-revenue .eri-v2-chart-stage {
    overflow: visible !important;
}


/* H11.0-P11.1-R27 — Daily Revenue donut isolation */
.ddb-echart-host--daily-revenue-donut {
    overflow: visible !important;
    pointer-events: auto;
}
