/* PLYX · Финансы: аналитика, графики, планирование (классы fx-). */
.fin { --fx-good: #4fcf86; --fx-bad: #ff6b6b; --fx-warn: #f5b942; }
.fin [hidden] { display: none !important; }

.fx-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.fx-head .fin-h { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.fx-head .fin-h svg { width: 18px; height: 18px; color: var(--fx-warn); }
.fx-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.fx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.fx-sub { margin-top: 8px; font-size: 12.5px; color: var(--mute); line-height: 1.5; }
.fx-sub b { color: var(--ink); }
.fx-warn { color: var(--fx-warn); }

/* Сегментированные переключатели */
.fx-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--wash); }
.fx-seg button { border: 0; background: transparent; color: var(--mute); font: inherit; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; cursor: pointer; transition: background .25s, color .25s; }
.fx-seg button:hover { color: var(--ink); }
.fx-seg button[aria-checked='true'] { background: var(--acc); color: var(--acc-ink); font-weight: 600; }
.fx-periods { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.fx-custom { display: inline-flex; align-items: center; gap: 6px; }
.fx-custom input { width: auto; }
.fx-span { color: var(--mute); font-size: 13px; margin-right: auto; }
.fx-delta { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.fx-delta[data-sign='up'] { color: var(--fx-good); background: color-mix(in srgb, var(--fx-good) 14%, transparent); }
.fx-delta[data-sign='down'] { color: var(--fx-bad); background: color-mix(in srgb, var(--fx-bad) 14%, transparent); }
.fx-delta[data-sign='flat'] { color: var(--mute); background: var(--wash); }

/* Столбчатая диаграмма */
.fx-plot { position: relative; height: 220px; margin: 4px 0 0 44px; }
.fx-plot .fin-chart__tick { position: absolute; left: 0; right: 0; bottom: var(--y); border-top: 1px dashed var(--line-soft); }
.fx-plot .fin-chart__tick[data-zero] { border-top: 1px solid var(--line); }
.fx-plot .fin-chart__tick span { position: absolute; right: calc(100% + 8px); transform: translateY(-50%); font-size: 11px; color: var(--mute); white-space: nowrap; }
.fx-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: clamp(1px, .6%, 6px); align-items: end; }
.fx-col { height: 100%; display: flex; align-items: flex-end; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 6px; }
.fx-col:hover, .fx-col[data-on] { background: var(--hl); }
.fx-col__bar { display: block; width: 100%; min-height: 2px; border-radius: 6px 6px 2px 2px; transform-origin: bottom; background: linear-gradient(180deg, color-mix(in srgb, var(--acc) 100%, #fff 18%), color-mix(in srgb, var(--acc) 55%, transparent)); box-shadow: 0 -4px 18px -8px var(--acc-glow); }
.fx-col__bar[data-zero] { background: var(--line); box-shadow: none; }
.fx-col[data-on] .fx-col__bar { filter: brightness(1.18); }
.fx-x { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); margin: 8px 0 0 44px; font-size: 10.5px; color: var(--mute); text-align: center; white-space: nowrap; }
.fx-x span { overflow: visible; }
.fx-tip { position: absolute; top: -6px; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--plx-surface); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; z-index: 2; box-shadow: 0 8px 20px -8px #000; }

/* Топ товаров */
.fx-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.fx-top__row { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.fx-top__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-top small { color: var(--mute); font-size: 11.5px; }
.fx-meter, .fx-progress { height: 8px; margin: 6px 0 4px; border-radius: 999px; background: var(--wash); overflow: hidden; }
.fx-meter span, .fx-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--acc) 60%, transparent), var(--acc)); }
.fx-meter span[data-bad] { background: linear-gradient(90deg, color-mix(in srgb, var(--fx-bad) 50%, transparent), var(--fx-bad)); }
.fx-progress { height: 14px; }

/* Кольцевая диаграмма */
.fx-buyers { display: grid; grid-template-columns: 130px 1fr; gap: 18px; align-items: center; }
.fx-ring { position: relative; width: 130px; height: 130px; }
.fx-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fx-ring circle { fill: none; stroke-width: 12; }
.fx-ring__bg { stroke: var(--wash); }
.fx-ring__fg { stroke: var(--acc); stroke-linecap: round; filter: drop-shadow(0 0 6px var(--acc-glow)); }
.fx-ring__label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.fx-ring__label strong { font-size: 22px; }
.fx-ring__label small { color: var(--mute); font-size: 11px; max-width: 90px; }
.fx-people { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.fx-people li { display: flex; justify-content: space-between; gap: 8px; }
.fx-people span { display: inline-flex; gap: 6px; align-items: center; }
.fx-people svg { width: 14px; height: 14px; color: var(--mute); }
.fx-people small { color: var(--mute); }

/* Тепловая карта */
.fx-heat { display: grid; grid-template-columns: 28px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10.5px; color: var(--mute); }
.fx-heat__h { text-align: center; }
.fx-heat__d { align-self: center; }
.fx-heat i { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--acc) calc(var(--a) * 100%), var(--wash)); opacity: calc(.35 + var(--a) * .65); transition: transform .2s; }
.fx-heat i:hover { transform: scale(1.35); outline: 1px solid var(--acc); }

/* Холд */
.fx-hand-line { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; color: var(--mute); }
.fx-hand-line svg { width: 16px; height: 16px; }
.fx-hand-line b { color: var(--ink); }
.fx-attention { border-color: color-mix(in srgb, var(--fx-warn) 45%, var(--line)); background: color-mix(in srgb, var(--fx-warn) 6%, var(--plx-surface)); }
.fx-alist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fx-alist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.fx-alist__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-alist__name small { display: block; color: var(--mute); font-size: 12px; }
.fx-age { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--wash); color: var(--mute); }
.fx-age[data-level='mid'] { background: color-mix(in srgb, var(--fx-warn) 18%, transparent); color: var(--fx-warn); }
.fx-age[data-level='high'] { background: color-mix(in srgb, var(--fx-bad) 18%, transparent); color: var(--fx-bad); }
.fx-stale td { background: color-mix(in srgb, var(--fx-warn) 5%, transparent); }
.fx-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); }
.fx-num { width: 70px !important; padding: 6px 8px !important; text-align: center; }
.fx-num--wide { width: 110px !important; }
.fx-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: 4px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.fx-icon:hover { border-color: var(--acc); color: var(--acc); }
.fx-icon svg { width: 15px; height: 15px; }

/* Таблицы */
.fx-tablewrap { overflow-x: auto; }
.fx-table { width: 100%; table-layout: auto; }
.fx-table td, .fx-table th { white-space: nowrap; }
.fx-table td[data-cell='main'] { white-space: normal; min-width: 180px; }
.fx-hand { font-weight: 600; color: var(--ink); }
.fx-hand sup { color: var(--mute); margin-left: 2px; }
.fx-more { padding: 10px 16px; }
.fx-store tr[data-level='loss'] td { background: color-mix(in srgb, var(--fx-bad) 9%, transparent); }
.fx-store tr[data-level='low'] td { background: color-mix(in srgb, var(--fx-warn) 7%, transparent); }
.fx-store tr[data-level='loss'] .fx-margin { color: var(--fx-bad); font-weight: 700; }
.fx-store tr[data-level='low'] .fx-margin { color: var(--fx-warn); font-weight: 700; }
.fx-store .fin-cell-title { max-width: 260px; }

/* Статус «Возврат» */
.fin-pill[data-status='refund'], .fin-pill[data-status='cancelled'] { border-color: color-mix(in srgb, var(--fx-bad) 40%, transparent); background: color-mix(in srgb, var(--fx-bad) 12%, transparent); color: var(--fx-bad); }
.fin-pill[data-status='refund'] svg, .fin-pill[data-status='cancelled'] svg { color: inherit; }

/* Калькулятор и планирование */
.fx-rev { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.fx-rev .fin-field { display: grid; gap: 6px; }
.fx-rev__out { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 14px; }
.fx-rev__price { padding: 12px 18px; border-radius: 14px; background: var(--acc-wash); border: 1px solid var(--acc-line); }
.fx-rev__price small { display: block; color: var(--mute); font-size: 12px; }
.fx-rev__price strong { font-size: 26px; color: var(--acc); }
.fx-rev__out .fin-help { flex: 1; min-width: 220px; }
.fx-goal__nums { display: flex; align-items: baseline; gap: 10px; }
.fx-goal__nums strong { font-size: 28px; }
.fx-goal__nums span { color: var(--mute); }
.fx-wform { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 12px; }
.fx-wlist { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.fx-wlist li { display: grid; grid-template-columns: 90px 1fr auto auto; gap: 10px; align-items: center; }
.fx-wlist small { color: var(--mute); }

@media (max-width: 640px) {
  .fx-buyers { grid-template-columns: 1fr; justify-items: center; }
  .fx-wform { grid-template-columns: 1fr 1fr; }
  .fx-heat { grid-template-columns: 24px repeat(24, minmax(0, 1fr)); gap: 2px; }
  .fx-plot { height: 180px; }
}
@media (prefers-reduced-motion: reduce) { .fx-heat i, .fx-seg button { transition: none; } }
