/* ---------- Дашборд в сетке Portfolio (22 октября 2026; js/tabs/overview.js) ----------
   Ряд 1 — четыре карточки: значок в кружке и название, крупное значение со стрелкой к прошлому периоду, цветная панель с
   графиком (чёрная, бирюзовая, чёрная, синяя; штриховка в правом нижнем углу). Ряд 2 (1 : 1,8 : 1,2) — «Совет дня»,
   «Перечислено с Ozon», «Товары». Цвета — токены tokens.css; панели одинаковы в обеих темах. */
.ov-row1 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ov-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1.2fr); gap: 12px; }
.ov-card { position: relative; min-width: 0; padding: 16px; border-radius: var(--r-card); background: var(--surface-1); box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease; }
.ov-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.ov-i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ov-ch { display: flex; align-items: center; gap: 12px; }
.ov-ic { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.ov-name { font-size: 16px; font-weight: 500; line-height: var(--lh-tight); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-link { margin-left: auto; color: var(--accent); text-decoration: none; white-space: nowrap; }
.ov-link:hover { color: var(--accent); }
.ov-vrow { margin-top: 16px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.ov-value { font-size: 28px; font-weight: 500; letter-spacing: -.01em; line-height: var(--lh-none); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--good-border); white-space: nowrap; }
.ov-delta.down { color: var(--bad-border); }
.ov-delta .ov-i { width: 12px; height: 12px; stroke-width: 2.4; }
.ov-ago { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ov-ago::before { content: "•"; margin-right: 4px; }

.ov-panel { position: relative; margin-top: 16px; height: 104px; border-radius: var(--r-panel); overflow: hidden; color: #fff; cursor: crosshair; }
.ov-panel.black { background: #111114; }
.ov-panel.teal { background: var(--teal); }
.ov-panel.blue { background: var(--blue); }
:root[data-theme="dark"] .ov-panel.black { background: #000; box-shadow: inset 0 0 0 1px var(--border); }
.ov-panel.hatch::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgb(255 255 255 / .06) 0 1px, transparent 1px 6px);
  -webkit-mask-image: linear-gradient(120deg, transparent 50%, #000 78%); mask-image: linear-gradient(120deg, transparent 50%, #000 78%); }
.ov-chart { position: absolute; inset: 0; width: 100%; height: 100%; }
.ov-line { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.ov-line.teal { stroke: var(--teal); }
.ov-line.white { stroke: #fff; }
.ov-bar { fill: #fff; opacity: .8; }
.ov-stripe { fill: #fff; opacity: .28; }
.ov-stripe.on { opacity: .9; }
.ov-block { fill: #e4e2fb; }
.ov-cursor { position: absolute; top: 8px; bottom: 8px; width: 1px; background: rgb(255 255 255 / .9); pointer-events: none; }
.ov-pin { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgb(255 255 255 / .25); pointer-events: none; }
.ov-chip { position: absolute; z-index: 1; padding: 4px 8px; border-radius: 8px; background: #111114; color: #fff; font-size: 12px; font-weight: 600;
  transform: translate(-50%, calc(-100% - 8px)); white-space: nowrap; line-height: var(--lh-tight); text-align: center; pointer-events: none; }
.ov-chip small { display: block; font-size: 10px; font-weight: 500; opacity: .65; }
.ov-panel.blue .ov-chip, .ov-panel.black .ov-chip { background: #fff; color: #111114; }
.ov-chip.below { transform: translate(-50%, 12px); }
.ov-tag { position: absolute; right: 16px; top: 16px; font-size: 15px; font-weight: 600; text-align: right; line-height: var(--lh-tight); }
.ov-tag small { display: block; margin-top: 4px; font-size: 10px; font-weight: 500; opacity: .6; }
.ov-foot { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; font-size: 12px; color: var(--text-muted); line-height: var(--lh-tight); }
.ov-foot b { color: var(--text-primary); font-weight: 600; }

/* «Совет дня» — цветок из лепестков и синий градиент с главной находкой аудита. */
.ov-advice { display: flex; flex-direction: column; overflow: hidden; }
.ov-chip-label { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--surface-2); font-size: 13px; font-weight: 500; }
.ov-flower { position: relative; height: 120px; margin-top: 8px; }
.ov-flower svg { position: absolute; left: 50%; bottom: -24px; width: 220px; height: 160px; transform: translateX(-50%); }
.ov-ask { position: relative; z-index: 1; flex: 1; margin: 0 -16px -16px; padding: 40px 16px 16px; border-radius: var(--r-card);
  background: linear-gradient(180deg, rgb(152 170 251 / .35) 0%, #98aafb 24%, #7389f9 60%, #6b83f8 100%);
  display: flex; flex-direction: column; align-items: center; text-align: center; color: #fff; }
.ov-ask p { font-size: 17px; font-weight: 500; line-height: var(--lh-tight); text-shadow: 0 1px 12px rgb(30 45 160 / .35); max-width: 320px; }
.ov-ask .ov-sub { margin-top: 8px; font-size: 12px; font-weight: 500; opacity: .85; }
.ov-logos { margin-top: 16px; display: flex; gap: 4px; }
.ov-logos .ov-coin { border: 1px solid rgb(255 255 255 / .5); }
:root .ov-ask button.primary { margin-top: auto; width: 100%; justify-content: center; gap: 8px; background: #111114; border-color: #111114; color: #fff; }
.ov-ask .ov-logos + button, .ov-ask .ov-sub + button { margin-top: 24px; }

/* «Перечислено с Ozon» — сумма, столбики или линия, выделенный диапазон бирюзой, тёмная подсказка, периоды пилюлями. */
.ov-balance { display: flex; flex-direction: column; }
.ov-bh { display: flex; align-items: flex-start; gap: 8px; }
.ov-lbl { font-size: 14px; color: var(--text-muted); }
.ov-big { margin-top: 4px; font-size: 32px; font-weight: 500; letter-spacing: -.01em; line-height: var(--lh-none); font-variant-numeric: tabular-nums; }
.ov-tools { margin-left: auto; display: flex; gap: 8px; }
:root .ov-ring { width: 40px; height: 40px; padding: 0; border-radius: 50%; justify-content: center; background: none; border: 1px solid var(--border); color: var(--text-primary); }
:root .ov-ring.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.ov-plot { position: relative; margin-top: 16px; flex: 1; min-height: 240px; display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.ov-yaxis { display: flex; flex-direction: column-reverse; justify-content: space-between; padding-top: 4px; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ov-area { position: relative; cursor: crosshair; }
.ov-area svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ov-col { fill: var(--surface-2); }
.ov-area-line { fill: none; stroke: var(--text-muted); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.ov-range { fill: var(--teal); opacity: .25; }
.ov-range-line { stroke: var(--teal); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ov-tip { position: absolute; z-index: 2; padding: 8px 12px; border-radius: 12px; background: #111114; color: #fff; transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap; pointer-events: none; box-shadow: 0 8px 20px rgb(17 17 20 / .2); line-height: var(--lh-tight); }
.ov-tip.r { transform: translate(calc(-100% + 16px), calc(-100% - 12px)); }
.ov-tip.l { transform: translate(-16px, calc(-100% - 12px)); }
.ov-tip b { display: block; font-size: 15px; font-weight: 600; }
.ov-tip span { font-size: 11px; color: #a1a5b0; }
.ov-frames { margin: 16px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
:root .ov-frames button { height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: none; color: var(--text-muted); font-size: 13px; }
:root .ov-frames button:hover { color: var(--text-primary); }
:root .ov-frames button.on { background: var(--ink); color: var(--on-ink); }
.ov-balance .tile-facts { margin-top: 16px; }

/* «Товары» — тёмная панель со строками: кружок с буквами артикула, артикул и название, сумма или маржа. */
.ov-gh { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 0; }
.ov-gh b { font-size: 16px; font-weight: 500; }
.ov-gh a { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text-muted); text-decoration: none; }
.ov-gh a:hover { color: var(--text-primary); }
.ov-holding { margin-top: 16px; padding: 16px; border-radius: var(--r-panel); background: #1c1c1f; color: #fff; }
:root[data-theme="dark"] .ov-holding { background: var(--surface-2); }
.ov-holding h3 { margin: 0; font-size: 13px; font-weight: 500; color: #d8dae0; }
.ov-holding h3 + .ov-rows { margin-top: 8px; }
.ov-holding .ov-rows + h3 { margin-top: 16px; }
.ov-hrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0;
  border-top: 1px solid rgb(255 255 255 / .08); }
.ov-rows .ov-hrow:first-child { border-top: 0; }
.ov-coin { width: 36px; height: 36px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.ov-coin.teal { background: var(--teal); color: #111114; }
.ov-coin.blue { background: var(--blue); }
.ov-coin.glass { background: rgb(255 255 255 / .28); font-size: 10px; }
/* Фото товара в кружке: белая подложка — у фото Ozon обычно белый фон, на бирюзе и синем он был бы пятном. */
.ov-coin.photo { background: #fff; }
.ov-coin img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ov-t { min-width: 0; line-height: var(--lh-tight); }
.ov-t b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-t span { display: block; margin-top: 2px; font-size: 11px; color: #8d919c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-amt { font-size: 15px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ov-amt.small { font-size: 13px; }
.ov-spark { display: flex; align-items: center; gap: 8px; }
.ov-badge { padding: 4px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; background: rgb(34 197 94 / .15); color: #4ade80; white-space: nowrap; }
.ov-badge.down { background: rgb(239 68 68 / .16); color: #f87171; }
.ov-none { margin: 8px 0 4px; font-size: 12px; color: #8d919c; }

/* Ряд 3 (владелец, 23 октября 2026): «Выручка и прибыль по дням» — две колонки сетки второго ряда, «РНП по артикулу» — третья,
   ровно под «Товарами». Сетка та же, что у .ov-row2, — края плиток совпадают. */
.ov-row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(0, 1.2fr); gap: 12px; align-items: stretch; }
.ov-row3 > .card { margin: 0; min-width: 0; transition: transform .2s ease, box-shadow .2s ease; }
/* Как у карточек выше (владелец, 23 октября 2026: «у двух новых плиток нет анимации, как у плиток выше»). */
.ov-row3 > .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.ov-row3 > .card:first-child { grid-column: span 2; }
/* График тянется на всю высоту ряда: svg — поверх блока, высоту блоку даёт ряд (drawChart берёт её у .chart.fill). */
.ov-row3 > .card:first-child { display: flex; flex-direction: column; }
.ov-row3 .chart.fill { position: relative; flex: 1; min-height: 240px; }
.ov-row3 .chart.fill > svg { position: absolute; inset: 0; }
.ov-row3 .rnp-pick-row { flex-wrap: nowrap; }
.ov-row3 .rnp-pick-row .field { flex: 1 1 auto; min-width: 0; max-width: none; }
.ov-row3 .rnp-pick-clear { flex: none; }
.ov-row3 .combo { max-width: none; }
/* Плитка РНП: товар, показатели за 7 дней, быстрый выбор. */
.rnp-tile-head, .rnp-tile-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.rnp-tile-head { margin-top: 16px; }
.rnp-tile-t { min-width: 0; line-height: var(--lh-tight); text-align: left; }
.rnp-tile-t b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rnp-tile-t span { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rnp-tile-cols, .rnp-tile-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px 72px; align-items: center; gap: 8px; }
.rnp-tile-cols { margin-top: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--grid); font-size: 11px; color: var(--text-muted); }
.rnp-tile-cols span:nth-child(n+2) { text-align: right; }
.rnp-tile-row { padding: 8px 0; border-bottom: 1px solid var(--grid); font-size: 13px; line-height: var(--lh-tight); }
.rnp-tile-row:last-child { border-bottom: 0; }
.rnp-tile-label { color: var(--text-secondary); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rnp-tile-total { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rnp-tile-row .rnp-spark { width: 72px; height: 20px; }
.rnp-tile-last { justify-self: end; padding: 2px 8px; border-radius: var(--r-pill); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rnp-tile-last.good { background: var(--good-bg); }
.rnp-tile-last.bad { background: var(--bad-bg); color: var(--bad-border); font-weight: 600; }
.rnp-tile-open { margin-top: 12px; }
.rnp-tile-quick { margin-top: 16px; display: grid; gap: 4px; }
.rnp-tile-cap { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
:root .rnp-tile-item { width: 100%; height: auto; padding: 8px; border: 0; border-radius: var(--r-field); background: none; box-shadow: none; font-weight: 400; }
:root .rnp-tile-item:hover { background: var(--surface-2); }
.rnp-tile-amt { font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) { .ov-card, .ov-row3 > .card { transition: none; } .ov-card:hover, .ov-row3 > .card:hover { transform: none; } }
@media (max-width: 1279px) {
  .ov-row1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-balance { grid-column: 1 / -1; order: -1; }
  .ov-row3 { grid-template-columns: minmax(0, 1fr); }
  .ov-row3 > .card:first-child { grid-column: auto; }
  .ov-row3 .chart.fill { flex: none; height: 240px; }
}
@media (max-width: 860px) {
  .ov-row1, .ov-row2 { grid-template-columns: minmax(0, 1fr); }
  .ov-value { font-size: 24px; }
  .ov-big { font-size: 28px; }
  .ov-plot { min-height: 200px; grid-template-columns: 56px minmax(0, 1fr); }
  .ov-frames { width: 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  .ov-card:hover, .ov-row3 > .card:hover { transform: none; }
}
