/* ============================================================================
   BARBAROS — analytics-premium.css (premium batch 2, ANALYTICS owner)
   ----------------------------------------------------------------------------
   Styles for the runtime-injected analytics panel (.anp) and the overview "Performance 7 jours"
   card (.anp-perf). Selectors are `html[data-buld-theme] .anp…` so they beat the legacy .an-* rules
   of orders.css. Tokens only (--buld-* / --bx-* / --p-*). No !important.

   Motion: UI transitions 120/180/240 ms with var(--bx-ease); chart draw-ins are DATA animations
   and use --anp-draw (600 ms) so a line, a donut or a bar can actually be read growing; everything
   collapses to 0 ms under prefers-reduced-motion.
   ============================================================================ */
:root {
    --anp-draw: 600ms;
    --anp-tone-info: var(--buld-cta);
    --anp-tone-success: var(--buld-success);
    --anp-tone-warning: var(--buld-warning);
    --anp-tone-danger: var(--buld-danger);
    --anp-tone-prev: var(--buld-ink-4);
}
@media (prefers-reduced-motion: reduce) { :root { --anp-draw: 0ms; } }

/* ----------------------------------------------------------------------------
   1. Panel shell + toolbar
   ---------------------------------------------------------------------------- */
html[data-buld-theme] .anp { color: var(--buld-ink-1); }
html[data-buld-theme] .anp-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    margin: 4px 0 18px;
}
html[data-buld-theme] .anp-seg {
    display: inline-flex; align-items: center; gap: 2px;
    height: var(--p-control-h, 32px); padding: 2px;
    border: 1px solid var(--buld-hairline); border-radius: 999px;
    background: var(--p-card-bg);
}
html[data-buld-theme] .anp-seg__btn {
    height: 26px; padding: 0 12px; border: 0; border-radius: 999px;
    background: transparent; color: var(--buld-ink-2);
    font: 500 12.5px/1 inherit; font-family: inherit; white-space: nowrap; cursor: pointer;
    transition: background var(--bx-dur-hover) var(--bx-ease), color var(--bx-dur-hover) var(--bx-ease), transform var(--bx-dur-hover) var(--bx-ease);
}
html[data-buld-theme] .anp-seg__btn:hover { background: var(--buld-hover); color: var(--buld-ink-1); }
html[data-buld-theme] .anp-seg__btn:active { transform: scale(.98); }
html[data-buld-theme] .anp-seg__btn[aria-pressed="true"] { background: var(--buld-cta); color: #fff; }
html[data-buld-theme] .anp-seg__btn:focus-visible { outline: 2px solid var(--buld-cta); outline-offset: 2px; }

html[data-buld-theme] .anp-custom { display: inline-flex; align-items: center; gap: 8px; }
html[data-buld-theme] .anp-custom[hidden] { display: none; }
html[data-buld-theme] .anp-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--buld-ink-3); }
html[data-buld-theme] .anp-field input {
    height: 32px; padding: 0 10px; border: 1px solid var(--buld-hairline); border-radius: 10px;
    background: var(--p-card-bg); color: var(--buld-ink-1); font-family: inherit; font-size: 12.5px;
    transition: border-color var(--bx-dur-hover) var(--bx-ease), box-shadow var(--bx-dur-hover) var(--bx-ease);
}
html[data-buld-theme] .anp-field input:focus { outline: none; border-color: var(--buld-cta); box-shadow: 0 0 0 3px var(--buld-cta-soft); }

html[data-buld-theme] .anp-apply,
html[data-buld-theme] .anp-ghost {
    display: inline-flex; align-items: center; gap: 6px;
    height: 32px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
    font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer;
    transition: background var(--bx-dur-hover) var(--bx-ease), transform var(--bx-dur-hover) var(--bx-ease), box-shadow var(--bx-dur-hover) var(--bx-ease);
}
html[data-buld-theme] .anp-apply { background: var(--buld-cta); color: #fff; }
html[data-buld-theme] .anp-apply:hover { background: var(--buld-cta-hover, var(--buld-cta)); }
html[data-buld-theme] .anp-ghost { background: transparent; color: var(--buld-ink-1); border-color: var(--buld-hairline); }
html[data-buld-theme] .anp-ghost:hover { background: var(--buld-hover); }
html[data-buld-theme] .anp-apply:active,
html[data-buld-theme] .anp-ghost:active { transform: scale(.98); }
html[data-buld-theme] .anp-apply:focus-visible,
html[data-buld-theme] .anp-ghost:focus-visible,
html[data-buld-theme] .anp-link:focus-visible { outline: 2px solid var(--buld-cta); outline-offset: 2px; }
html[data-buld-theme] .anp-apply svg,
html[data-buld-theme] .anp-ghost svg { width: 15px; height: 15px; }

/* compare switch */
html[data-buld-theme] .anp-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 12.5px; color: var(--buld-ink-2); }
html[data-buld-theme] .anp-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
html[data-buld-theme] .anp-toggle__track {
    position: relative; width: 36px; height: 20px; border-radius: 999px; flex-shrink: 0;
    background: var(--buld-divider);
    transition: background var(--bx-dur-overlay, 180ms) var(--bx-ease);
}
html[data-buld-theme] .anp-toggle__track::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: var(--bx-shadow-1);
    transition: transform var(--bx-dur-overlay, 180ms) var(--bx-ease);
}
html[data-buld-theme] .anp-toggle input:checked + .anp-toggle__track { background: var(--buld-cta); }
html[data-buld-theme] .anp-toggle input:checked + .anp-toggle__track::after { transform: translateX(16px); }
html[data-buld-theme] .anp-toggle input:focus-visible + .anp-toggle__track { outline: 2px solid var(--buld-cta); outline-offset: 2px; }
html[data-buld-theme] .anp-range { margin-inline-start: auto; font-size: 12.5px; color: var(--buld-ink-3); font-variant-numeric: tabular-nums; }

html[data-buld-theme] .anp-note {
    display: flex; align-items: center; gap: 8px; margin: -4px 0 14px;
    font-size: 12.5px; color: var(--buld-ink-3);
}
html[data-buld-theme] .anp-note svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ----------------------------------------------------------------------------
   2. KPI row
   ---------------------------------------------------------------------------- */
html[data-buld-theme] .anp-kpis {
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px;
}
html[data-buld-theme] .anp-kpi {
    display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 18px;
    transition: transform var(--bx-dur-hover) var(--bx-ease), box-shadow var(--bx-dur-hover) var(--bx-ease);
}
html[data-buld-theme] .anp-kpi:hover,
html[data-buld-theme] .anp-sec:hover { transform: translateY(-1px); box-shadow: var(--bx-shadow-2); }
html[data-buld-theme] .anp-kpi__label { font-size: 12px; font-weight: 500; color: var(--buld-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-buld-theme] .anp-kpi__value {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
    color: var(--buld-ink-1); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html[data-buld-theme] .anp-delta {
    display: inline-flex; align-items: center; gap: 3px; width: fit-content;
    font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--buld-ink-3);
}
html[data-buld-theme] .anp-delta svg { width: 14px; height: 14px; }
html[data-buld-theme] .anp-delta[data-tone="good"] { color: var(--buld-success); }
html[data-buld-theme] .anp-delta[data-tone="bad"]  { color: var(--buld-danger); }
html[data-buld-theme] .anp-delta[data-tone="none"] { color: var(--buld-ink-4); }

/* ----------------------------------------------------------------------------
   3. Card grid
   ---------------------------------------------------------------------------- */
html[data-buld-theme] .anp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
html[data-buld-theme] .anp-sec { display: flex; flex-direction: column; min-width: 0; transition: transform var(--bx-dur-hover) var(--bx-ease), box-shadow var(--bx-dur-hover) var(--bx-ease); }
html[data-buld-theme] .anp-sec--wide { grid-column: span 2; }
html[data-buld-theme] .anp-sec__head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 16px 18px 0;
}
html[data-buld-theme] .anp-sec__title { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--buld-ink-1); }
html[data-buld-theme] .anp-sec__sub { font-size: 12px; color: var(--buld-ink-3); }
html[data-buld-theme] .anp-sec__body { position: relative; flex: 1; padding: 12px 18px 18px; min-width: 0; }
html[data-buld-theme] .anp-sec .p-empty--compact { padding: 26px 12px 18px; }

/* ----------------------------------------------------------------------------
   4. Revenue area chart (inline SVG)
   ---------------------------------------------------------------------------- */
html[data-buld-theme] .anp-chart { position: relative; width: 100%; min-height: 64px; }
html[data-buld-theme] .anp-area { display: block; width: 100%; height: auto; color: var(--buld-cta); overflow: visible; font-family: inherit; }
html[data-buld-theme] .anp-area [hidden] { display: none; }
html[data-buld-theme] .anp-area__grid { stroke: var(--buld-hairline); stroke-width: 1; }
html[data-buld-theme] .anp-area__axis { stroke: var(--buld-divider); stroke-width: 1; }
html[data-buld-theme] .anp-area__ylabel,
html[data-buld-theme] .anp-area__xlabel { fill: var(--buld-ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
html[data-buld-theme] .anp-area__line { stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[data-buld-theme] .anp-area__line.is-drawing { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
html[data-buld-theme] .anp-area__line.is-drawn { stroke-dashoffset: 0; transition: stroke-dashoffset var(--anp-draw) var(--bx-ease); }
html[data-buld-theme] .anp-area__fill.is-drawing { opacity: 0; }
html[data-buld-theme] .anp-area__fill.is-drawn { opacity: 1; transition: opacity var(--anp-draw) var(--bx-ease) calc(var(--anp-draw) * .4); }
html[data-buld-theme] .anp-area__prev { stroke: var(--anp-tone-prev); stroke-width: 1.5; stroke-dasharray: 4 4; stroke-linecap: round; }
html[data-buld-theme] .anp-area__dot { fill: currentColor; }
html[data-buld-theme] .anp-area__cross { stroke: var(--buld-divider); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
html[data-buld-theme] .anp-area__hoverdot { fill: var(--buld-cta); stroke: var(--p-card-bg); stroke-width: 2; pointer-events: none; }
html[data-buld-theme] .anp-area__hit { cursor: crosshair; }
html[data-buld-theme] .anp-chart-legend { display: inline-flex; gap: 14px; font-size: 12px; color: var(--buld-ink-3); }
html[data-buld-theme] .anp-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }

html[data-buld-theme] .anp-tip {
    position: absolute; left: var(--x, 0); top: var(--y, 0); z-index: 2;
    display: flex; flex-direction: column; gap: 3px; min-width: 150px; padding: 9px 11px;
    border: 1px solid var(--buld-hairline); border-radius: 10px;
    background: var(--p-card-bg); color: var(--buld-ink-1); box-shadow: var(--bx-shadow-2);
    font-size: 12.5px; font-variant-numeric: tabular-nums; pointer-events: none;
    transform: translateY(-100%);
}
html[data-buld-theme] .anp-tip[hidden] { display: none; }
html[data-buld-theme] .anp-tip strong { font-size: 12px; font-weight: 600; color: var(--buld-ink-2); text-transform: capitalize; }
html[data-buld-theme] .anp-tip span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
html[data-buld-theme] .anp-tip .anp-tip__sub { font-weight: 400; color: var(--buld-ink-3); }

html[data-buld-theme] .anp-legend__dot,
html[data-buld-theme] .anp-tip__dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--buld-ink-4); }
html[data-buld-theme] [data-tone="info"].anp-legend__dot,    html[data-buld-theme] [data-tone="info"].anp-tip__dot    { background: var(--anp-tone-info); }
html[data-buld-theme] [data-tone="success"].anp-legend__dot                                                        { background: var(--anp-tone-success); }
html[data-buld-theme] [data-tone="warning"].anp-legend__dot                                                        { background: var(--anp-tone-warning); }
html[data-buld-theme] [data-tone="danger"].anp-legend__dot                                                         { background: var(--anp-tone-danger); }
html[data-buld-theme] [data-tone="prev"].anp-legend__dot,    html[data-buld-theme] [data-tone="prev"].anp-tip__dot    { background: var(--anp-tone-prev); }
html[data-buld-theme] [data-shade="2"].anp-legend__dot { opacity: .55; }

/* ----------------------------------------------------------------------------
   5. Donut (orders by status)
   ---------------------------------------------------------------------------- */
html[data-buld-theme] .anp-donut-wrap { display: flex; align-items: center; gap: 24px; }
html[data-buld-theme] .anp-donut-wrap { position: relative; width: 156px; flex-shrink: 0; }
html[data-buld-theme] .anp-donut { display: block; width: 100%; height: auto; transform: rotate(-90deg); }
html[data-buld-theme] .anp-donut__track { fill: none; stroke: var(--buld-hover); stroke-width: 14; }
html[data-buld-theme] .anp-donut__seg { fill: none; stroke-width: 14; transition: stroke-dasharray var(--anp-draw) var(--bx-ease); }
html[data-buld-theme] .anp-donut__seg[data-tone="info"]    { stroke: var(--anp-tone-info); }
html[data-buld-theme] .anp-donut__seg[data-tone="success"] { stroke: var(--anp-tone-success); }
html[data-buld-theme] .anp-donut__seg[data-tone="warning"] { stroke: var(--anp-tone-warning); }
html[data-buld-theme] .anp-donut__seg[data-tone="danger"]  { stroke: var(--anp-tone-danger); }
html[data-buld-theme] .anp-donut__seg[data-shade="2"] { opacity: .55; }
html[data-buld-theme] .anp-donut__center {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; pointer-events: none;
}
html[data-buld-theme] .anp-donut__center strong { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; color: var(--buld-ink-1); font-variant-numeric: tabular-nums; }
html[data-buld-theme] .anp-donut__center span { font-size: 11px; color: var(--buld-ink-3); }
html[data-buld-theme] .anp-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
html[data-buld-theme] .anp-legend__row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 52px; align-items: center; gap: 10px; font-size: 12.5px; }
html[data-buld-theme] .anp-legend__label { color: var(--buld-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-buld-theme] .anp-legend__count { color: var(--buld-ink-1); font-weight: 600; font-variant-numeric: tabular-nums; }
html[data-buld-theme] .anp-legend__pct { color: var(--buld-ink-3); text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------------------
   6. Horizontal bars (wilayas), rate bars, funnel
   ---------------------------------------------------------------------------- */
html[data-buld-theme] .anp-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
html[data-buld-theme] .anp-bar {
    display: grid; grid-template-columns: 18px minmax(80px, 128px) minmax(0, 1fr) 40px 112px; align-items: center; gap: 10px;
    min-height: 30px; font-size: 13px;
}
html[data-buld-theme] .anp-bar__rank { font-size: 11px; color: var(--buld-ink-4); font-variant-numeric: tabular-nums; }
html[data-buld-theme] .anp-bar__name { color: var(--buld-ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-buld-theme] .anp-bar__track { display: block; height: 8px; border-radius: 999px; background: var(--buld-hover); overflow: hidden; min-width: 0; }
html[data-buld-theme] .anp-bar__fill {
    display: block; height: 100%; width: 0; border-radius: 999px; background: var(--buld-cta);
    transition: width var(--anp-draw) var(--bx-ease) calc(var(--i, 0) * 40ms);
}
html[data-buld-theme] .is-in .anp-bar__fill,
html[data-buld-theme] .is-in > .anp-bar__track > .anp-bar__fill { width: var(--w, 0%); }
html[data-buld-theme] .anp-bar__track--success .anp-bar__fill { background: var(--buld-success); }
html[data-buld-theme] .anp-bar__count { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--buld-ink-1); }
html[data-buld-theme] .anp-bar__rev { text-align: right; font-size: 12.5px; color: var(--buld-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* products */
html[data-buld-theme] .anp-products { list-style: none; margin: 0; padding: 0; }
html[data-buld-theme] .anp-product { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 0; border-top: 1px solid var(--buld-hairline); }
html[data-buld-theme] .anp-product:first-child { border-top: 0; }
html[data-buld-theme] .anp-thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--buld-hover); flex-shrink: 0; }
html[data-buld-theme] .anp-thumb--ph { display: inline-flex; align-items: center; justify-content: center; color: var(--buld-ink-3); }
html[data-buld-theme] .anp-thumb--ph svg { width: 16px; height: 16px; }
html[data-buld-theme] .anp-product__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
html[data-buld-theme] .anp-product__text strong { font-size: 13px; font-weight: 600; color: var(--buld-ink-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-buld-theme] .anp-product__text small { font-size: 12px; color: var(--buld-ink-3); }
html[data-buld-theme] .anp-product__rev { font-size: 13px; font-weight: 600; color: var(--buld-ink-1); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* carriers table */
html[data-buld-theme] .anp-table { display: flex; flex-direction: column; font-size: 13px; }
html[data-buld-theme] .anp-table__head,
html[data-buld-theme] .anp-table__row { display: grid; grid-template-columns: minmax(0, 1.4fr) .55fr .55fr .6fr minmax(120px, 1.6fr); align-items: center; gap: 10px; }
html[data-buld-theme] .anp-table__head { padding: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--buld-ink-3); border-bottom: 1px solid var(--buld-hairline); }
html[data-buld-theme] .anp-table__row { padding: 10px 0; border-bottom: 1px solid var(--buld-hairline); color: var(--buld-ink-2); font-variant-numeric: tabular-nums; }
html[data-buld-theme] .anp-table__row:last-child { border-bottom: 0; }
html[data-buld-theme] .anp-table__name { color: var(--buld-ink-1); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-buld-theme] .anp-table__rate { display: flex; align-items: center; gap: 10px; }
html[data-buld-theme] .anp-table__rate .anp-bar__track { flex: 1; }
html[data-buld-theme] .anp-table__rate em { font-style: normal; font-weight: 600; color: var(--buld-ink-1); min-width: 48px; text-align: right; }

/* funnel */
html[data-buld-theme] .anp-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
html[data-buld-theme] .anp-funnel__step {
    display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 16px;
    border: 1px solid var(--buld-hairline); border-radius: 10px;
}
html[data-buld-theme] .anp-funnel__label { font-size: 12px; font-weight: 500; color: var(--buld-ink-3); }
html[data-buld-theme] .anp-funnel__count { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; color: var(--buld-ink-1); font-variant-numeric: tabular-nums; }
html[data-buld-theme] .anp-funnel__meta { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--buld-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-buld-theme] .anp-funnel__meta svg { width: 12px; height: 12px; flex-shrink: 0; }
html[data-buld-theme] .anp-funnel--compact .anp-funnel__step { padding: 12px 14px; gap: 6px; }
html[data-buld-theme] .anp-funnel--compact .anp-funnel__count { font-size: 20px; }

/* ----------------------------------------------------------------------------
   7. Empty hero, skeletons, reveal
   ---------------------------------------------------------------------------- */
html[data-buld-theme] .anp-hero-empty { margin-top: 8px; }
html[data-buld-theme] .anp-hero-empty .p-empty { padding: 64px 24px; }
html[data-buld-theme] .anp-hero-empty .p-empty__icon { width: 56px; height: 56px; border-radius: 16px; color: var(--buld-cta); background: var(--buld-cta-soft); }
html[data-buld-theme] .anp-hero-empty .p-empty__icon svg { width: 26px; height: 26px; }
html[data-buld-theme] .anp-hero-empty .p-empty__title { font-size: 17px; }

html[data-buld-theme] .anp-loading { display: block; }
html[data-buld-theme] .anp-sk {
    position: relative; overflow: hidden; border-radius: 10px; background: var(--buld-hover);
}
html[data-buld-theme] .anp-sk::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent 0%, var(--p-card-bg) 50%, transparent 100%);
    opacity: .55; transform: translateX(-100%);
    animation: anp-shimmer 1.4s var(--bx-ease) infinite;
}
@keyframes anp-shimmer { to { transform: translateX(100%); } }
html[data-buld-theme] .anp-sk-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
html[data-buld-theme] .anp-sk--kpi { height: 84px; }
html[data-buld-theme] .anp-sk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
html[data-buld-theme] .anp-sk--wide { grid-column: span 2; height: 300px; }
html[data-buld-theme] .anp-sk--card { height: 240px; }
html[data-buld-theme] .anp-sk--row { height: 40px; margin-bottom: 10px; }
html[data-buld-theme] .anp-sk--row:last-child { margin-bottom: 0; }

html[data-buld-theme] .anp [data-reveal] { opacity: 0; transform: translateY(6px); }
html[data-buld-theme] .anp .is-visible [data-reveal],
html[data-buld-theme] .anp.is-visible [data-reveal] {
    opacity: 1; transform: none;
    transition: opacity var(--bx-dur-layout, 240ms) var(--bx-ease), transform var(--bx-dur-layout, 240ms) var(--bx-ease);
}
html[data-buld-theme] .anp .is-visible [data-reveal]:nth-child(2) { transition-delay: 40ms; }
html[data-buld-theme] .anp .is-visible [data-reveal]:nth-child(3) { transition-delay: 80ms; }
html[data-buld-theme] .anp .is-visible [data-reveal]:nth-child(4) { transition-delay: 120ms; }
html[data-buld-theme] .anp .is-visible [data-reveal]:nth-child(5) { transition-delay: 160ms; }
html[data-buld-theme] .anp .is-visible [data-reveal]:nth-child(6) { transition-delay: 200ms; }

/* ----------------------------------------------------------------------------
   8. Overview — "Performance 7 jours" card + real funnel
   ---------------------------------------------------------------------------- */
html[data-buld-theme] .anp-perf { margin: 16px 0; }
html[data-buld-theme] .anp-perf__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
html[data-buld-theme] .anp-perf__head > div { display: flex; flex-direction: column; gap: 2px; }
html[data-buld-theme] .anp-link {
    display: inline-flex; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: transparent;
    color: var(--buld-cta); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
    transition: transform var(--bx-dur-hover) var(--bx-ease);
}
html[data-buld-theme] .anp-link:hover { text-decoration: underline; text-underline-offset: 3px; }
html[data-buld-theme] .anp-link:active { transform: scale(.98); }
html[data-buld-theme] .anp-link svg { width: 15px; height: 15px; }
html[data-buld-theme] .anp-perf__body { display: flex; align-items: stretch; gap: 28px; padding: 10px 18px 16px; }
html[data-buld-theme] .anp-perf__spark { flex: 1 1 40%; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; }
html[data-buld-theme] .anp-chart--spark { min-height: 64px; }
html[data-buld-theme] .anp-perf__sparklabel { font-size: 11px; color: var(--buld-ink-3); }
html[data-buld-theme] .anp-perf__stats { flex: 1 1 60%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
html[data-buld-theme] .anp-perf__stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-inline-start: 14px; border-inline-start: 1px solid var(--buld-hairline); }
html[data-buld-theme] .anp-perf__stat .anp-kpi__value { font-size: 20px; }
html[data-buld-theme] .anp-perf .anp-loading { padding-top: 4px; }

/* the legacy .funnel-section box keeps its surface (orders.css); only its content changes */
html[data-buld-theme] .anp-funnel-host .anp-sec__head { padding: 0 0 12px; }
html[data-buld-theme] .anp-funnel-host .anp-sec__body { padding: 0; }
html[data-buld-theme] .anp-funnel-host .anp-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ----------------------------------------------------------------------------
   9. Responsive + reduced motion
   ---------------------------------------------------------------------------- */
@media (max-width: 1180px) {
    html[data-buld-theme] .anp-kpis,
    html[data-buld-theme] .anp-sk-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    html[data-buld-theme] .anp-grid,
    html[data-buld-theme] .anp-sk-grid { grid-template-columns: minmax(0, 1fr); }
    html[data-buld-theme] .anp-sec--wide,
    html[data-buld-theme] .anp-sk--wide { grid-column: auto; }
    html[data-buld-theme] .anp-perf__body { flex-direction: column; gap: 16px; }
    html[data-buld-theme] .anp-perf__stat { padding-inline-start: 0; border-inline-start: 0; }
}
@media (max-width: 680px) {
    html[data-buld-theme] .anp-kpis,
    html[data-buld-theme] .anp-sk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html[data-buld-theme] .anp-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    html[data-buld-theme] .anp-bar { grid-template-columns: 18px minmax(70px, 1fr) minmax(0, 1fr) 36px; }
    html[data-buld-theme] .anp-bar__rev { display: none; }
    html[data-buld-theme] .anp-table__head, html[data-buld-theme] .anp-table__row { grid-template-columns: minmax(0, 1.2fr) .5fr .5fr minmax(90px, 1.4fr); }
    html[data-buld-theme] .anp-table__head span:nth-child(4), html[data-buld-theme] .anp-table__row span:nth-child(4) { display: none; }
    html[data-buld-theme] .anp-donut-wrap { flex-direction: column; align-items: stretch; }
    html[data-buld-theme] .anp-donut-wrap { margin: 0 auto; }
    html[data-buld-theme] .anp-perf__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    html[data-buld-theme] .anp-range { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
    html[data-buld-theme] .anp *,
    html[data-buld-theme] .anp-perf *,
    html[data-buld-theme] .anp-funnel-host * { transition-duration: 0ms; animation-duration: 0ms; }
    html[data-buld-theme] .anp [data-reveal] { opacity: 1; transform: none; }
}

/* collisions: legacy [class*="-card"] / [class*="-box"] painters (buld-theme 1343, sidebar.css 491-503) repaint the
   analytics surfaces grey / dark. The analytics cards are white (light) / elevated (dark) with a hairline. */
html[data-buld-theme] body #panel-analytics .anp-kpi, html[data-buld-theme] body #panel-analytics .anp-sec,
html[data-buld-theme] body #panel-overview .anp-perf, html[data-buld-theme] body #panel-overview .anp-sec {
    background: var(--p-card-bg) !important; background-image: none !important; border: 1px solid var(--p-card-border) !important;
    border-radius: var(--p-card-radius) !important; box-shadow: none !important; color: var(--buld-ink-1) !important;
}
html[data-buld-theme="light"] body #panel-analytics .anp-kpi, html[data-buld-theme="light"] body #panel-analytics .anp-sec,
html[data-buld-theme="light"] body #panel-overview .anp-perf { box-shadow: var(--bx-shadow-1) !important; }
html[data-buld-theme] body .anp-donut-wrap { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; }
html[data-buld-theme] body .anp-perf *, html[data-buld-theme] body .anp-sec *, html[data-buld-theme] body .anp-kpi * { background-image: none; }
html[data-buld-theme] body .anp-perf .anp-perf__sub, html[data-buld-theme] body .anp-perf small, html[data-buld-theme] body .anp-perf span:not([class*="val"]):not([class*="delta"]) { background: transparent !important; border: 0 !important; padding-inline: 0; }
html[data-buld-theme] body .anp-sec__title, html[data-buld-theme] body .anp-sec__sub, html[data-buld-theme] body .anp-perf__head *, html[data-buld-theme] body .anp-legend *, html[data-buld-theme] body .anp-donut__center * {
    background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important;
}
html[data-buld-theme] body .anp-perf__head .anp-link { padding: 0 !important; }
/* id-level specificity: dark-fix's long :not() chains out-rank class selectors even with !important */
html[data-buld-theme] body #panel-analytics .anp-donut-wrap, html[data-buld-theme] body #panel-overview .anp-donut-wrap { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
html[data-buld-theme] body #panel-analytics .anp-kpi, html[data-buld-theme] body #panel-analytics .anp-sec, html[data-buld-theme] body #panel-overview .anp-perf { background: var(--p-card-bg) !important; }
html[data-buld-theme] body #panel-overview .anp-perf__head *, html[data-buld-theme] body #panel-overview .anp-perf .anp-sec__title, html[data-buld-theme] body #panel-overview .anp-perf .anp-sec__sub,
html[data-buld-theme] body #panel-analytics .anp-sec__title, html[data-buld-theme] body #panel-analytics .anp-sec__sub, html[data-buld-theme] body #panel-analytics .anp-legend * {
    background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important;
}
