﻿.dashboard-toc-series-swatch {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--mud-palette-lines-default);
    flex-shrink: 0;
}

/* Compact tree spacing */
.dashboard-toc-tree .mud-treeview-item {
    margin: 0 !important;
    padding: 0 !important;
}

.dashboard-toc-tree .mud-treeview-item-content {
    min-height: 26px !important;
    height: 28px !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.dashboard-toc-tree .mud-treeview-item-group {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.dashboard-tree-item,
.chartview-tree-item,
.timeseries-tree-item {
    min-height: 24px !important;
    height: 26px !important;
    gap: 4px !important;
}

/* Remove MudTreeView default selected styling */
.dashboard-toc-tree .mud-treeview-item-content,
.dashboard-toc-tree .mud-treeview-item-content:hover,
.dashboard-toc-tree .mud-treeview-item-content.mud-selected,
.dashboard-toc-tree .mud-treeview-item-content.mud-selected:hover,
.dashboard-toc-tree .mud-treeview-item-content[aria-selected="true"],
.dashboard-toc-tree .mud-treeview-item-content[aria-selected="true"]:hover {
    background-color: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

    /* Selected MudTreeView row */
    .dashboard-toc-tree .mud-treeview-item-content.mud-selected,
    .dashboard-toc-tree .mud-treeview-item-content[aria-selected="true"] {
        background-color: transparent !important;
        color: #222 !important;
    }

/* Selected branch */
.dashboard-tree-item-selected {
    background-color: #ffd700 !important;
    border-radius: 4px;
    padding-inline: 4px;
}

.chartview-tree-item-selected-parent {
    background-color: #faee89 !important; /* midway between yellow and lightgoldenrodyellow */
    border-radius: 4px;
    padding-inline: 4px;
}

.timeseries-tree-item-selected-parent {
    background-color: lightgoldenrodyellow !important;
    border-radius: 4px;
    padding-inline: 4px;
}

    .dashboard-tree-item-selected :not(.mud-chip):not(.mud-chip *),
    .chartview-tree-item-selected-parent :not(.mud-chip):not(.mud-chip *),
    .timeseries-tree-item-selected-parent :not(.mud-chip):not(.mud-chip *) {
        color: #222 !important;
    }

/* Unselected branch */
.dashboard-tree-item-unselected,
.chartview-tree-item-unselected-parent,
.timeseries-tree-item-unselected-parent {
    background-color: white !important;
    border-radius: 4px;
    padding-inline: 4px;
}

    .dashboard-tree-item-unselected :not(.mud-chip):not(.mud-chip *),
    .chartview-tree-item-unselected-parent :not(.mud-chip):not(.mud-chip *),
    .timeseries-tree-item-unselected-parent :not(.mud-chip):not(.mud-chip *) {
        color: #9e9e9e !important;
    }

    .dashboard-tree-item-unselected .mud-icon-root,
    .chartview-tree-item-unselected-parent .mud-icon-root,
    .timeseries-tree-item-unselected-parent .mud-icon-root {
        color: #bdbdbd !important;
    }

/* Dashboard/chart annotation chips */
.dashboard-annotation-chip-unselected {
    background-color: transparent !important;
    color: #9e9e9e !important;
    border: 1px solid #bdbdbd !important;
}

    .dashboard-annotation-chip-unselected * {
        color: #9e9e9e !important;
    }

.dashboard-annotation-chip-selected {
    background-color: transparent !important;
    color: #444 !important;
    border: 1px solid #c8c08a !important;
}

    .dashboard-annotation-chip-selected * {
        color: #444 !important;
    }

/* Keep chips from being clipped */
.dashboard-toc-tree .mud-chip {
    height: 21px !important;
    min-height: 21px !important;
    line-height: 21px !important;
}

/* Selected time-series chip: use CSS vars from TimeSeriesNameTemplate */
.timeseries-tree-item-selected-parent .timeseries-format-chip,
.timeseries-tree-item-selected-parent .timeseries-format-chip.mud-chip {
    background-color: var(--series-bg) !important;
    border-color: var(--series-bg) !important;
    color: var(--series-fg) !important;
}

    .timeseries-tree-item-selected-parent .timeseries-format-chip *,
    .timeseries-tree-item-selected-parent .timeseries-format-chip.mud-chip * {
        color: var(--series-fg) !important;
    }

/* Unselected time-series chip: grey with white text */
.timeseries-tree-item-unselected-parent .timeseries-format-chip,
.timeseries-tree-item-unselected-parent .timeseries-format-chip.mud-chip {
    background-color: #cfcfcf !important;
    border-color: #cfcfcf !important;
    color: white !important;
}

    .timeseries-tree-item-unselected-parent .timeseries-format-chip *,
    .timeseries-tree-item-unselected-parent .timeseries-format-chip.mud-chip * {
        color: white !important;
    }

/* Preserve swatch */
.dashboard-toc-series-swatch,
.timeseries-tree-item-selected-parent .dashboard-toc-series-swatch,
.timeseries-tree-item-unselected-parent .dashboard-toc-series-swatch {
    color: unset !important;
}
