/* ============================================================================================
   SVG charts (BarChart, ColumnChart, TrendChart) - the rules WebOffice carries in its app.css,
   for applications that do not load that file (HQ). WebOffice keeps its own copy, so nothing it
   draws changes. Reads the shared theme tokens from AdvDeli.Catalog.UI's theme.css; the chart
   colour tokens fall back to WebOffice's values when a host does not define them.
   ============================================================================================ */

.ch { margin: 0; }
.ch-cap { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.ch-ttl { font-size: .92rem; font-weight: 750; color: var(--c-text); }
.ch-sub { font-size: .78rem; color: var(--c-text-dim); }
.ch-svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-empty { padding: 34px 12px; text-align: center; color: var(--c-text-faint); font-style: italic; font-size: .86rem; }

.ch-grid { stroke: var(--rc-grid, var(--c-line)); stroke-width: 1; }
.ch-axis { stroke: var(--rc-axis, var(--c-line-strong)); stroke-width: 1; }

.ch-tick, .ch-cat { fill: var(--c-text-faint); font-size: 11px; }
.ch-val { fill: var(--c-text); font-size: 11.5px; font-weight: 750; }

.ch-mark { fill: var(--rc-mark, #1F6FB2); }
.ch-line { fill: none; stroke: var(--rc-mark, #1F6FB2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-area { fill: var(--rc-wash, rgba(31, 111, 178, .12)); stroke: none; }

.ch-hit { fill: transparent; }
.ch-col:hover .ch-mark, .ch-bar:hover .ch-mark { fill: var(--c-accent-text); }

.ch-cross { stroke: var(--rc-axis, var(--c-line-strong)); stroke-width: 1; opacity: 0; }
.ch-pt:hover .ch-cross { opacity: 1; }

.ch-dot { fill: var(--rc-mark, #1F6FB2); stroke: var(--c-s2); stroke-width: 2; opacity: 0; }
.ch-dot.on { opacity: 1; }
.ch-pt:hover .ch-dot { opacity: 1; }

/* ---- 2026-10-21: emphasis, comparison line, pie / donut - see WebOffice app.css for the notes;
   these carry the light values as fallbacks for a host that defines no --rc-* tokens. ---- */
.ch-mark.dim { fill: var(--rc-dim, #c5ced9); }
.ch-line.prev { stroke: var(--rc-prev, #94a3b8); stroke-width: 1.75; stroke-dasharray: 5 4; }

.ch-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; font-size: .76rem; color: var(--c-text-dim); }
.ch-key { display: inline-flex; align-items: center; gap: 6px; }
.ch-key-line { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--rc-mark, #1F6FB2); }
.ch-key-line.prev { border-top: 2px dashed var(--rc-prev, #94a3b8); }

/* LEGEND TOP-RIGHT, the Power BI / Tableau convention (2026-10-23): the chart owns the card's body,
   centred, and the legend sits in the top-right corner beside it rather than vertically centred in
   the middle of the card. On a narrow card it moves above the chart, still right-aligned. */
.dn { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "chart legend";
    align-items: start; column-gap: 20px; row-gap: 12px; }
.dn-svg { grid-area: chart; justify-self: center; align-self: center;
    width: 200px; height: 200px; overflow: visible; }
@media (max-width: 520px) {
    .dn { grid-template-columns: minmax(0, 1fr); grid-template-areas: "legend" "chart"; }
}
.dn-mark { fill: var(--dn); stroke: var(--c-s2, #fff); stroke-width: 2; stroke-linejoin: round; transition: opacity .12s ease; }
.dn-svg:hover .dn-mark { opacity: .55; }
.dn-svg .dn-slice:hover .dn-mark { opacity: 1; }
.dn-pct { fill: #111827; font-size: 12px; font-weight: 800; pointer-events: none; }
.dn .s0 .dn-pct { fill: #ffffff; }
.dn-total { fill: var(--c-text); font-size: 19px; font-weight: 800; }
.dn-total-lbl { fill: var(--c-text-faint); font-size: 11px; }

/* ONE GRID FOR THE WHOLE LEGEND (2026-10-23): swatch, name, amount. The name column is only as wide
   as the longest name, so each amount sits just after its category (it used to be pushed to the far
   edge of the card) while the amounts still line up. No % column - the share is on the slice. */
.dn-legend { grid-area: legend; justify-self: end; align-self: start;
    list-style: none; margin: 0; padding: 0; min-width: 0; max-width: 100%;
    display: grid; grid-template-columns: 10px minmax(0, max-content) auto;
    align-items: center; column-gap: 8px; row-gap: 7px; font-size: .78rem; }
.dn-legend li { display: contents; }
/* Round markers and a quiet name, as the BI tools draw a legend; the amount carries the weight. */
.dn-sw { width: 10px; height: 10px; border-radius: 50%; background: var(--dn); }
.dn-name { color: var(--c-text-dim, #4b5563); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dn-amt { color: var(--c-text); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dn-share { color: var(--c-text-dim); text-align: right; font-variant-numeric: tabular-nums; }

.dn .s0 { --dn: var(--rc-cat-0, #1F6FB2); }
.dn .s1 { --dn: var(--rc-cat-1, #eb6834); }
.dn .s2 { --dn: var(--rc-cat-2, #1baf7a); }
.dn .s3 { --dn: var(--rc-cat-3, #eda100); }
.dn .s4 { --dn: var(--rc-cat-4, #e87ba4); }
.dn .s-other { --dn: var(--rc-cat-other, #9aa3ad); }
