/* NeuroProfit Dashboard — layout & tables (PATRIOT theme in patriot-theme.css) */

body.dashboard-compact {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Единая плотность всех таблиц: крупнее текст без роста строк. */
table:not(.matrix-analysis-table) {
  font-size: 1.18rem !important;
  line-height: 1.1;
}

table:not(.matrix-analysis-table) thead th {
  padding: 6px 8px !important;
}

table:not(.matrix-analysis-table) tbody td {
  padding: 3px 8px !important;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: clip;
  padding-left: 252px;
  width: 100%;
  max-width: 100%;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: 252px;
  flex: 0 0 252px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  padding: 0 0 12px;
  overflow-x: hidden;
  position: fixed;
  left: 0;
  top: var(--dashboard-header-height);
  bottom: 0;
  height: auto;
  max-height: none;
  z-index: 50;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 0;
  overflow: auto;
  flex: 1;
}

.nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: var(--radius);
  color: var(--gray);
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
  transition: background 0.12s, color 0.12s;
}

.nav a:hover {
  background: var(--orange-soft);
  color: var(--orange);
}

.nav a.active {
  background: var(--orange);
  color: #fff;
}

.nav a.active:hover {
  background: var(--orange-dark);
}

.nav .cnt {
  font-size: 0.72rem;
  color: var(--gray-mid);
  background: #f0f0f0;
  border-radius: 20px;
  padding: 2px 8px;
  flex: 0 0 auto;
  font-weight: 700;
}

.nav a.active .cnt {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.2);
}

.nav-section {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-light);
  padding: 14px 11px 6px;
  margin-top: 2px;
}

.nav-section:first-child {
  padding-top: 4px;
  margin-top: 0;
}

.nav a.nav-live {
  border-left: 3px solid #2a9d52;
  padding-left: 8px;
}

.nav a.nav-live.active {
  border-left-color: rgba(255, 255, 255, 0.65);
}

.nav .nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav .nav-left > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2a9d52;
  flex: 0 0 7px;
  box-shadow: 0 0 5px rgba(42, 157, 82, 0.45);
}

.nav a.active .live-dot {
  background: #fff;
  box-shadow: none;
}

.side-foot {
  padding: 12px 14px 0;
  border-top: 1px solid #eee;
  margin-top: auto;
}

.source {
  font-size: 0.72rem;
  color: var(--gray-mid);
  line-height: 1.5;
}

.scroll-top-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 10px;
  background: #d92d20;
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 8px 22px rgba(127, 29, 29, 0.24);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  pointer-events: none;
  transition-property: opacity, transform, background-color, box-shadow;
  transition-duration: 180ms;
  transition-timing-function: ease-out;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: #b42318;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.08),
    0 10px 26px rgba(127, 29, 29, 0.3);
}

.scroll-top-btn:active {
  transform: translateY(0) scale(0.96);
}

.scroll-top-btn:focus-visible {
  outline: 3px solid rgba(217, 45, 32, 0.28);
  outline-offset: 3px;
}

.scroll-top-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.scroll-top-btn-label {
  white-space: nowrap;
}

@media (max-width: 720px) {
  .scroll-top-btn {
    right: 14px;
    bottom: 14px;
    width: 44px;
    padding: 0;
  }

  .scroll-top-btn-label {
    display: none;
  }
}

/* ── Main ────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 10px 12px 12px;
  min-width: 0;
}

.page-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.topbar-left {
  flex: 1;
  min-width: min(100%, 280px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topbar-headline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.page-blurb {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--gray-mid, #555);
  background: var(--orange-soft, #fff8f3);
  border-left: 3px solid var(--orange, #ff5100);
  border-radius: 0 6px 6px 0;
  max-width: 820px;
}

.page-toolbar h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--gray);
  padding-bottom: 0;
  border-bottom: none;
}

.meta {
  font-size: 0.78rem;
  color: var(--gray-mid);
  margin-left: 8px;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  padding-top: 2px;
}

.search {
  width: 260px;
  max-width: 38vw;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(255, 81, 0, 0.15);
}

.kpis:empty {
  display: none !important;
}

/* ── Note banner ─────────────────────────────────────────── */
.note {
  margin: 0 0 10px;
  padding: 10px 14px;
  background: var(--orange-soft);
  border: 1px solid rgba(255, 81, 0, 0.25);
  border-radius: var(--radius);
  color: #8a3800;
  font-size: 0.82rem;
  font-weight: 600;
}

.note-live {
  background: #edfbf2;
  border-color: #b6f0cf;
  color: #1a6637;
}

/* ── Table ───────────────────────────────────────────────── */
:root {
  --np-table-offset: 300px;
}

/* Единое Excel-поведение: весь текст во всех таблицах выровнен влево. */
#app table :is(th, td),
#articleModal table :is(th, td) {
  text-align: left !important;
  font-variant-numeric: tabular-nums;
}

.np-excel-table {
  table-layout: fixed;
}

.np-excel-table th {
  position: relative;
}

.np-excel-filter-row th {
  z-index: 3;
  padding: 4px 5px !important;
  background: #e8edf2 !important;
  border-color: #aeb8c2 !important;
  cursor: default !important;
}

.np-excel-filter-row input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 8px;
  border: 1px solid #9aa7b4;
  border-radius: 3px;
  color: #111;
  background: #fff;
  font: inherit;
  outline: none;
}

.np-excel-filter-row input:focus,
.np-excel-filter-row input.is-active {
  border-color: #ff5100;
  box-shadow: 0 0 0 2px rgba(255, 81, 0, 0.16);
}

.np-excel-filter-row input::placeholder {
  color: #687684;
  opacity: 1;
}

.np-sortable {
  padding-right: 27px !important;
  cursor: pointer;
  user-select: none;
}

.np-sortable::before {
  content: '⇅';
  position: absolute;
  right: 11px;
  top: 50%;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

.np-sortable.np-sort-asc::before { content: '▲'; }
.np-sortable.np-sort-desc::before { content: '▼'; }

.np-col-resizer {
  position: absolute;
  z-index: 6;
  top: 0;
  right: -5px;
  bottom: 0;
  width: 10px;
  min-height: 40px;
  cursor: col-resize;
  touch-action: none;
}

.np-col-resizer::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 4px;
  bottom: 8px;
  width: 2px;
  background: rgba(255, 255, 255, 0.5);
}

.np-col-resizer:hover::after,
body.np-table-resizing .np-col-resizer::after {
  background: #ff5100;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75);
}

body.np-table-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

/* Цветовые шкалы из Excel-эталона: зелёный/красный фон, серый для пустых данных. */
.matrix-analysis-table tbody td.matrix-excel-fill {
  color: #111 !important;
  background: var(--matrix-cell-fill) !important;
}

.matrix-analysis-table tbody td.matrix-cell-missing {
  color: #5d6873 !important;
  background: #e7e9ec !important;
}

.matrix-analysis-table tbody td.matrix-cell-no-comparison {
  color: #333 !important;
  background: #f5f6f7 !important;
}

.matrix-analysis-table tbody td.matrix-trend-stable {
  color: #111 !important;
}

.tablewrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  min-height: 0;
}

.table-panel {
  flex: 0 1 auto;
  height: auto;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: 0;
  overflow: hidden;
}

.table-xscroll {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  max-height: calc(100dvh - var(--np-table-offset, 300px));
  min-height: 0;
  overflow: hidden;
}

.table-xscroll-bar {
  flex: 0 0 auto;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: 16px;
  background: #fafafa;
  border-color: #ececec;
}

.table-xscroll-bar-top {
  border-bottom: 1px solid #ececec;
}

.table-xscroll-bar-bottom {
  border-top: 1px solid #ececec;
}

.table-xscroll-spacer {
  height: 1px;
}

.table-xscroll-body.tablehost {
  flex: 0 0 auto;
  height: auto;
  max-height: calc(100dvh - var(--np-table-offset, 300px));
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
}

.table-xscroll-pane {
  display: block;
  min-width: 100%;
}

.table-xscroll-pane > table {
  width: max-content;
  min-width: 100%;
}

.tablehost {
  flex: 0 0 auto;
  height: auto;
  max-height: calc(100dvh - var(--np-table-offset, 300px));
  overflow: auto;
  padding: 0;
}

.tablehost.is-loading {
  overflow: hidden;
  min-height: 240px;
}

.table-loading {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 28px 24px;
  background:
    linear-gradient(180deg, rgba(255, 81, 0, 0.04), rgba(255, 81, 0, 0.01)),
    #fff;
}

.table-loading-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-loading-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 81, 0, 0.14);
  border-top-color: var(--orange, #ff5100);
  animation: tableSpinner 0.9s linear infinite;
  flex: 0 0 auto;
}

.table-loading-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.table-loading-title {
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--gray, #333);
}

.table-loading-hint {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--gray-mid, #666);
}

.table-loading-bars {
  display: grid;
  gap: 10px;
}

.table-loading-bar {
  position: relative;
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: #f3f3f3;
}

.table-loading-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 35%,
    rgba(255, 81, 0, 0.3) 50%,
    rgba(255, 255, 255, 0.45) 65%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: tableShimmer 1.35s ease-in-out infinite;
}

.table-loading-bar:nth-child(1) { width: 100%; }
.table-loading-bar:nth-child(2) { width: 92%; }
.table-loading-bar:nth-child(3) { width: 97%; }
.table-loading-bar:nth-child(4) { width: 88%; }
.table-loading-bar:nth-child(5) { width: 95%; }
.table-loading-bar:nth-child(6) { width: 84%; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 1.18rem;
  line-height: 1.1;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--orange);
  color: #fff;
  text-align: right;
  padding: 6px 8px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: none;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

thead th.t-text {
  text-align: left;
}

thead th:hover {
  background: var(--orange-dark);
}

thead th .arrow {
  color: rgba(255, 255, 255, 0.85);
  margin-left: 4px;
  font-size: 10px;
}

tbody td {
  padding: 3px 8px;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--gray);
  vertical-align: top;
}

tbody td.t-text {
  text-align: left;
}

/* Матричный анализ: заголовок и плотность повторяют исходный Excel. */
.matrix-analysis-table {
  font-size: 0.95rem;
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

.matrix-analysis-table thead th.matrix-col {
  background: #3d4c5f;
  color: #fff;
  border: 1px solid #000;
  font-size: 0.875rem;
  font-weight: 400;
  padding: 5px;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.1;
}

.matrix-analysis-table .matrix-header-row th.matrix-col {
  position: sticky;
  top: 0;
  height: 64px;
  z-index: 5;
  vertical-align: middle;
  box-shadow: 0 1px 0 #000;
}

.matrix-analysis-table .matrix-product-photo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: #fff;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.matrix2-table .matrix-group-label-row th {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 48px;
  padding: 4px 5px;
  color: #fff;
  background: #27384a;
  border: 1px solid #000;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
}

.matrix2-table .matrix-header-row th.matrix-col {
  top: 48px;
}

.matrix2-table .matrix-filter-row th {
  top: 112px;
}

.matrix2-table .matrix-group-label-row th:nth-child(4n+2) { background: #3f6f45; }
.matrix2-table .matrix-group-label-row th:nth-child(4n+3) { background: #a96b00; }
.matrix2-table .matrix-group-label-row th:nth-child(4n+4) { background: #365f91; }

.matrix-analysis-table .matrix-header-row th.matrix-col:hover {
  background: #4a5b70;
}

.matrix-analysis-table .matrix-header-row th.matrix-col-conditional_price,
.matrix-analysis-table .matrix-header-row th.matrix-col-orders_sum,
.matrix-analysis-table .matrix-header-row th.matrix-col-turnover_share,
.matrix-analysis-table .matrix-header-row th.matrix-col-payable {
  background: #70ad47;
}

.matrix-analysis-table .matrix-header-row th.matrix-col-orders_before_spp,
.matrix-analysis-table .matrix-header-row th.matrix-col-sales_per_day {
  background: #ffc000;
  color: #1f2933;
}

.matrix-analysis-table .matrix-header-row th.matrix-col-spp {
  background: #548235;
}

.matrix-analysis-table .matrix-header-row th.matrix-col-buyouts {
  background: #5b9bd5;
}

.matrix-analysis-table .matrix-header-row th[data-key="name"] {
  text-align: left;
}

.matrix-analysis-table tbody td.matrix-col {
  border-right: 1px solid #e3e7eb;
  padding: 4px 5px;
  height: auto;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.matrix-analysis-table :is(th, td).matrix-group-start {
  border-left: 2px solid #111;
}

.matrix-analysis-table .matrix-filter-row th {
  position: sticky;
  top: 64px;
  z-index: 4;
  height: 44px;
  padding: 5px;
  background: #e8edf2;
  border: 1px solid #aeb8c2;
  cursor: default;
  overflow: visible;
}

.matrix-analysis-table .matrix-filter-row th:hover {
  background: #e8edf2;
}

.matrix-analysis-table .matrix-filter-row input {
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  min-width: 0;
  padding: 4px 5px;
  color: #1f2933;
  background: #fff;
  border: 1px solid #9aa7b4;
  border-radius: 4px;
  outline: none;
  font: inherit;
  font-size: 0.875rem;
  transition-property: border-color, box-shadow;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}

.matrix-analysis-table .matrix-filter-row input:focus {
  border-color: #ff5100;
  box-shadow: 0 0 0 2px rgba(255, 81, 0, 0.18);
}

.matrix-analysis-table .matrix-filter-row input::placeholder {
  color: #7c8996;
  opacity: 1;
}

.matrix-col-resizer {
  position: absolute;
  top: 0;
  right: -8px;
  z-index: 8;
  width: 16px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.matrix-col-resizer::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: rgba(255, 255, 255, 0.55);
  transition-property: background-color, width;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}

.matrix-col-resizer:hover::after,
body.matrix-resizing .matrix-col-resizer::after {
  width: 3px;
  background: #ff5100;
}

body.matrix-resizing {
  cursor: col-resize;
  user-select: none;
}

.matrix-filter-empty {
  padding: 22px 18px;
  text-align: left;
  color: #687684;
  white-space: normal;
}

.matrix-more-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.matrix-show-more {
  min-height: 40px;
  transition-property: transform, background-color, color;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}

.matrix-show-more:active {
  transform: scale(0.96);
}

.cell-sub {
  font-size: 0.72rem;
  color: var(--gray-mid);
  font-weight: 500;
  margin-top: 2px;
  max-width: 280px;
  white-space: normal;
  line-height: 1.35;
}

tbody tr:nth-child(even) td {
  background: var(--orange-soft);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--orange-soft);
}

tbody tr.grp td {
  background: var(--orange-soft);
  font-weight: 700;
  color: var(--orange-dark);
  border-top: 1px solid rgba(255, 81, 0, 0.2);
  border-bottom: 1px solid rgba(255, 81, 0, 0.2);
}

td.pos {
  color: #2a9d52;
  font-weight: 600;
}

td.neg {
  color: #d42b2b;
  font-weight: 600;
}

td.cell-pct.pos {
  background: #e8f7ee;
}

td.cell-pct.neg {
  background: #fdeaea;
}

.thumb {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  vertical-align: middle;
  background: #f0f0f0;
  display: inline-block;
}

.thumb-lg {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0f0f0;
  display: block;
}

.thumb-placeholder {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
  border: 1px dashed #ddd;
}

.product-col {
  min-width: 320px;
  max-width: 480px;
  vertical-align: top;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.product-cell-no-photo {
  gap: 0;
}

.product-photo {
  flex: 0 0 52px;
}

.product-body {
  flex: 1 1 auto;
  min-width: 0;
}

.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.product-name-link,
.product-name-text {
  flex: 0 1 auto;
  font-weight: 700;
  font-size: 0.86rem;
  line-height: 1.3;
  color: var(--gray);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-name-link {
  color: var(--orange-dark);
  text-decoration: none;
}

button.product-name-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.product-name-link:hover {
  text-decoration: underline;
  color: var(--orange);
}

.product-meta {
  font-size: 0.72rem;
  color: var(--gray-mid);
  margin-top: 2px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-meta-sep {
  margin: 0 4px;
  opacity: 0.5;
}

.product-art,
.product-cat {
  display: inline;
}

.product-metrics {
  font-size: 12px;
  color: var(--gray-mid, #666);
  margin-top: 4px;
  font-weight: 600;
}

.tovary-mp-cell {
  min-width: 190px;
  vertical-align: top;
}

.tovary-mp-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  max-width: 240px;
}

.tovary-mp-icons {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  flex-wrap: wrap;
}

.tovary-mp-icons .mp-icon-cell {
  min-width: 38px;
}

.tovary-mp-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  line-height: 1.25;
  color: var(--gray-mid, #666);
  white-space: nowrap;
}

.tovary-mp-line span:first-child {
  color: var(--text-muted, #777);
  font-weight: 600;
}

.tovary-mp-line b {
  color: var(--gray, #333);
  font-weight: 800;
}

.tovary-api-line {
  padding-top: 2px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.product-metrics .t-up,
.spark-delta.t-up,
.t-up {
  color: #1a7a3a;
  font-weight: 800;
}

.product-metrics .t-down,
.spark-delta.t-down,
.t-down {
  color: #b91c1c;
  font-weight: 800;
}

.product-trend-chart {
  margin-top: 6px;
}

.product-trend-chart .spark {
  display: block;
  max-width: 100%;
}

.spark-cell {
  min-width: 130px;
}

.spark-delta {
  font-size: 11px;
  margin-top: 2px;
  font-weight: 700;
}

.ir-kpi-chart {
  margin-top: 12px;
}

.ir-kpi-canvas {
  height: 240px;
  position: relative;
}

/* ── Interactive spark bars ── */
.ispark-wrap {
  position: relative;
  display: inline-block;
}

.ispark-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
  width: 100%;
}

.ispark-bar {
  flex: 1;
  min-width: 4px;
  border: none;
  border-radius: 3px 3px 0 0;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s, opacity 0.12s;
  background: var(--orange, #ff5100);
}

.ispark-bar-up {
  background: linear-gradient(to top, #1a7a3a, #2a9d52);
}

.ispark-bar-down {
  background: linear-gradient(to top, #b91c1c, #d42b2b);
}

.ispark-bar:hover,
.ispark-bar-active {
  transform: scaleY(1.08);
  filter: brightness(1.1);
  z-index: 2;
}

.ispark-bar-clicked {
  animation: ispark-pulse 0.35s ease;
}

.ispark-bar-enter {
  animation: ispark-grow 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: bottom center;
}

@keyframes ispark-grow {
  from {
    opacity: 0;
    transform: scaleY(0.15);
  }
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes ispark-pulse {
  0% { transform: scaleY(1); }
  50% { transform: scaleY(1.15); filter: brightness(1.2); }
  100% { transform: scaleY(1); }
}

.ispark-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ispark-tip strong {
  display: block;
  font-size: 12px;
}

/* ── Supply tree (prognoz) ── */
.supply-tree-hint {
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: var(--gray-mid, #666);
  line-height: 1.45;
}

.st-hint-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.st-hint-list li {
  margin-bottom: 4px;
}

.st-status-ok-inline { color: #1a7a3a; font-weight: 700; }
.st-status-bad-inline { color: #b91c1c; font-weight: 700; }

.st-product-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.st-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.st-status-ok {
  background: #e8f5ec;
  color: #1a7a3a;
  border: 1px solid #a7d4b5;
}

.st-status-bad {
  background: #fdecec;
  color: #b91c1c;
  border: 1px solid #f5b5b5;
}

.st-status-warn {
  background: #fff8e6;
  color: #b45309;
  border: 1px solid #fcd34d;
}

.st-row-ok {
  box-shadow: inset 4px 0 0 #1a7a3a;
}

.st-row-bad {
  box-shadow: inset 4px 0 0 #b91c1c;
}

.st-row-warn {
  box-shadow: inset 4px 0 0 #f59e0b;
}

.st-cluster-synthetic .st-cluster-name {
  font-style: italic;
  color: #666;
}

.st-stock-ok {
  border-color: #a7d4b5 !important;
  background: #f0faf3 !important;
}

.st-stock-ok .st-metric-val {
  color: #1a7a3a !important;
}

.st-stock-bad {
  border-color: #f5b5b5 !important;
  background: #fff5f5 !important;
}

.st-stock-bad .st-metric-val {
  color: #b91c1c !important;
}

.st-product-row.row-clickable {
  cursor: pointer;
}

.st-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  line-height: 1.25;
  max-width: 280px;
}

.st-mp-prices {
  margin-top: 6px;
}

table.supply-tree {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.supply-tree th {
  background: var(--orange);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 2;
}

table.supply-tree td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.st-product-row {
  background: #fff;
}

.st-product-row:hover,
.st-cluster-row:hover {
  background: var(--orange-soft, #fff5ee);
}

.st-cluster-row {
  background: #fafafa;
}

.st-product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.st-thumb {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: #f5f5f5;
}

.st-expand {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  flex-shrink: 0;
}

.st-expand.is-open {
  background: var(--orange-soft);
  border-color: var(--orange);
}

.st-product-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.st-art {
  font-weight: 800;
  font-size: 15px;
  color: var(--orange);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.st-abc, .st-barcode, .st-margin, .st-orders-total {
  font-size: 11px;
  color: var(--gray-mid, #666);
}

.product-side {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  flex-shrink: 0;
  margin-left: auto;
  align-self: flex-end;
  min-height: 38px;
  padding-bottom: 1px;
}

.abc-badges {
  display: flex;
  flex-shrink: 0;
  margin-right: 8px;
  gap: 6px;
  align-items: flex-end;
}

.abc-badge-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 34px;
}

.abc-badge-cap {
  font-size: 7px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--gray-mid);
  text-align: center;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.abc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  border: 2px solid transparent;
}

.abc-badge-letter { line-height: 1; }

.abc-badge.abc-A {
  background: #1a7a3a;
  color: #fff;
  border-color: #145c2d;
}

.abc-badge.abc-B {
  background: #f59e0b;
  color: #1a1a1a;
  border-color: #d97706;
}

.abc-badge.abc-C {
  background: #e5e7eb;
  color: #4b5563;
  border-color: #9ca3af;
}

.abc-badge.abc-empty {
  background: transparent;
  color: #9ca3af;
  border-color: #d1d5db;
  font-weight: 400;
}

.abc-col .abc-badges { justify-content: flex-start; }

.st-margin.pos { color: #1a7a3a; }
.st-margin.neg { color: #b91c1c; }

.st-cluster-cell {
  padding-left: 48px !important;
}

.st-cluster-indent {
  display: inline-block;
  width: 20px;
  border-left: 2px solid var(--orange);
  margin-right: 8px;
  height: 20px;
  vertical-align: middle;
}

.st-cluster-name {
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}

.st-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.st-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 64px;
  padding: 6px 10px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.st-metric:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.st-metric-warn {
  border-color: rgba(255, 81, 0, 0.5);
  background: #fff8f3;
}

.st-metric-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  font-weight: 700;
  min-height: 2.4em;
  line-height: 1.2;
}

.st-metric-val {
  font-size: 16px;
  font-weight: 800;
  color: #222;
}

.st-metric-warn .st-metric-val {
  color: var(--orange);
}

.st-opd-btn {
  font-size: 18px;
  font-weight: 800;
  color: var(--orange);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
}

.st-click.st-pulse {
  animation: ispark-pulse 0.35s ease;
}

.st-col-spark {
  min-width: 240px;
}

.product-mp-icons {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  column-gap: 6px;
}

.mp-icon-cell-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  min-width: 0;
  padding: 0;
  outline: none !important;
  flex-direction: row;
}

.mp-icon-cell-mini .mp-icon {
  width: 22px;
  height: 22px;
}

.product-mp-icons .mp-icon-cell-mini {
  flex: 0 0 26px;
}

.mp-icons-row,
.product-mp-icons,
.article-links,
.focus-mp-prices {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.mp-icon-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  text-decoration: none;
  min-width: 42px;
  vertical-align: top;
}

.mp-icon-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-muted, #666);
  white-space: nowrap;
  letter-spacing: -0.02em;
  text-align: center;
}

.mp-icon-price-val {
  font-size: 10px;
  font-weight: 800;
  color: var(--orange-dark, #e85d04);
  line-height: 1.15;
}

.mp-icon-promo {
  font-size: 7px;
  font-weight: 700;
  line-height: 1.15;
  color: #2a9d52;
  white-space: normal;
  max-width: 72px;
  text-align: center;
}

.mp-icon-cell:hover .mp-icon {
  transform: scale(1.08);
  opacity: 0.92;
}

.mp-icon-cell-miss {
  cursor: default;
}

.mp-icon-cell:hover .mp-icon-price-val {
  color: var(--orange, #e85d04);
}

.mp-icon.mp-icon-dim {
  opacity: 0.45;
}

.mp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.12s, opacity 0.12s;
}

.mp-icon:hover {
  transform: scale(1.08);
  opacity: 0.92;
}

.mp-icon.mp-icon-miss {
  background: #ececec;
  border: 1px dashed #d0d0d0;
  cursor: default;
  width: 18px;
  height: 18px;
}

.mp-icon.mp-icon-oos {
  opacity: 0.72;
  filter: grayscale(0.15);
}

.mp-icon-cross {
  position: absolute;
  inset: -1px;
  pointer-events: none;
}

.mp-icon-cross::before,
.mp-icon-cross::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 12%;
  width: 2px;
  height: 76%;
  background: #e02020;
  border-radius: 1px;
  transform: translateX(-50%) rotate(45deg);
  box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.85);
}

.mp-icon-cross::after {
  transform: translateX(-50%) rotate(-45deg);
}

.mp-icon-cell-nolink {
  cursor: default;
}

.mp-icon-cell-nolink .mp-icon {
  opacity: 0.92;
}

.mp-icon-cell-oos {
  cursor: pointer;
}

.mp-icon-cell-oos:hover .mp-icon {
  transform: none;
  opacity: 0.72;
}

.mp-icon-price-oos {
  color: #c62828;
  font-weight: 700;
}

.mp-icon-stock-oos {
  color: #c62828;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: -0.02em;
}

.mp-icon-cell-oos:hover .mp-icon-price-oos {
  color: #c62828;
}

.ca-mp-stock-zero,
.ca-insight-mp-oos .ca-mp-stock-zero {
  color: #c62828;
  font-weight: 700;
}

.ca-supply-stock .ca-mp-stock-zero {
  color: #c62828;
}

.mp-icon-issue {
  display: block;
  max-width: 52px;
  font-size: 7px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  letter-spacing: -0.01em;
}

.mp-icon-cell.mp-icon-cell-oos .mp-icon-cross::before,
.mp-icon-cell.mp-icon-cell-oos .mp-icon-cross::after {
  height: 88%;
  width: 2.5px;
  background: #d40000;
}

.mp-icon-cell.mp-icon-cell-mp-issue-oos {
  opacity: 0.95;
}

.mp-icon-cell.mp-icon-cell-mp-issue-loss,
.mp-icon-cell.mp-icon-cell-mp-issue-margin {
  outline: 1px solid rgba(224, 32, 32, 0.35);
  outline-offset: 1px;
  border-radius: 6px;
  padding: 1px 2px 2px;
}

.mp-icon-cell.mp-icon-cell-mp-issue-price-low {
  outline: 1px solid rgba(232, 93, 4, 0.45);
  outline-offset: 1px;
  border-radius: 6px;
  padding: 1px 2px 2px;
}

.mp-icon-cell.mp-icon-cell-mp-issue-price-high {
  outline: 1px solid rgba(91, 79, 207, 0.45);
  outline-offset: 1px;
  border-radius: 6px;
  padding: 1px 2px 2px;
}

.mp-issue-oos { color: #c62828; }
.mp-issue-loss { color: #c62828; }
.mp-issue-margin { color: #e65100; }
.mp-issue-price-low { color: #e65100; }
.mp-issue-price-high { color: #5b4fcf; }

.mp-icon-price-low-margin,
.mp-icon-price-loss { color: #c62828; }
.mp-icon-price-price-low { color: #e65100; }
.mp-icon-price-price-high { color: #5b4fcf; }

.mp-icon.mp-icon-mp-issue-loss,
.mp-icon.mp-icon-mp-issue-margin {
  box-shadow: 0 0 0 1px rgba(224, 32, 32, 0.35);
}

.mp-icon.mp-icon-mp-issue-price-low {
  box-shadow: 0 0 0 1px rgba(232, 93, 4, 0.45);
}

.mp-icon.mp-icon-mp-issue-price-high {
  box-shadow: 0 0 0 1px rgba(91, 79, 207, 0.45);
}

.product-detail-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-mid);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.product-detail-icon:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
  background: #fff8f3;
}

.product-detail-wow {
  animation: tilePulse 2.5s ease-in-out infinite;
  border-color: var(--orange);
}

.product-detail-wow:hover {
  background: var(--orange);
  color: #fff;
}

.article-title-link {
  color: inherit;
  text-decoration: none;
}

.article-title-link:hover {
  color: var(--orange);
  text-decoration: underline;
}

.foot-hint {
  color: var(--orange-dark);
  font-weight: 600;
}

/* ── Card analytics (15 metrics) ─────────────────────────── */
.card-analytics-host {
  margin-bottom: 12px;
}

.ca-supply-hero {
  margin-bottom: 16px;
  border: 2px solid #fed7aa;
  background: linear-gradient(180deg, #fffbeb 0%, #fff 48%);
}

.ca-supply-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.ca-supply-head h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.ca-supply-lead strong {
  color: #c2410c;
  font-size: 1.1em;
}

.ca-supply-table .ca-supply-qty {
  font-size: 1.05rem;
  color: #c2410c;
}

.ca-supply-pri {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffedd5;
  font-weight: 700;
  font-size: 0.75rem;
}

.insight-card.is-supply {
  border-color: #fdba74;
  background: #fff7ed;
}

.ca-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  align-items: stretch;
}

.ca-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  height: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease-out both;
}

.ca-tile.ca-neg .ca-tile-value {
  color: #d42b2b;
}

.ca-tile-label {
  flex: 0 0 auto;
  width: 100%;
  min-height: 2.6em;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-mid);
  margin-bottom: 6px;
  line-height: 1.3;
}

.ca-tile-value {
  flex: 0 0 auto;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--orange-dark);
  line-height: 1.25;
  min-height: 1.25em;
}

.ca-tile-hint {
  flex: 0 0 auto;
  font-size: 0.68rem;
  color: #999;
  margin-top: 4px;
  line-height: 1.25;
}

.ca-trend {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 4px;
}

.ca-trend.ca-up { color: #2a9d52; }
.ca-trend.ca-down { color: #d42b2b; }

.ca-chart-wrap {
  padding: 14px;
  margin-bottom: 12px;
}

.recon-verdict {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
}

.recon-detail h3 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
}

.recon-table th {
  font-weight: 600;
  white-space: nowrap;
}

.recon-table td,
.recon-table th {
  font-size: 0.84rem;
  vertical-align: top;
}

.recon-warn {
  color: #d42b2b;
  font-weight: 700;
}

.recon-hint,
.recon-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
}

.ca-chart-canvas {
  position: relative;
  height: 280px;
  max-height: 320px;
}

.ca-chart-detail {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  z-index: 2;
  margin: 0;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 81, 0, 0.25);
  border-left: 3px solid var(--orange);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  pointer-events: none;
  animation: fadeUp 0.2s ease-out;
}

.ca-chart-detail-neg {
  border-left-color: #d42b2b;
  background: rgba(255, 248, 248, 0.97);
}

.ca-chart-detail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gaps: 8px;
}

.ca-chart-detail-val {
  color: var(--orange-dark);
  font-weight: 800;
  font-size: 1rem;
}

.ca-chart-detail-neg .ca-chart-detail-val {
  color: #d42b2b;
}

.ca-chart-detail-hint {
  margin: 4px 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
}

.ca-chart-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 248px;
}

.ca-chart-title,
.ca-insights h4 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray);
}

.ca-insights {
  padding: 14px;
  margin-bottom: 10px;
}

.ca-insights ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.ca-sources {
  margin: 8px 0 0;
  font-size: 0.75rem;
}

.ca-mp-ratings h4,
.ca-recs h4,
.ca-card-quality h4 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.ca-mp-ratings-lead,
.ca-quality-lead {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.75rem;
}

.ca-mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
}

.ca-mp-block {
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ca-mp-block.ca-mp-warn {
  border-color: rgba(212, 43, 43, 0.45);
  background: rgba(212, 43, 43, 0.08);
}

.ca-mp-label {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.ca-mp-rating {
  font-size: 1.15rem;
  font-weight: 700;
}

.ca-mp-stars {
  font-size: 0.85rem;
  opacity: 0.85;
}

.ca-mp-meta {
  font-size: 0.75rem;
  opacity: 0.75;
  margin-top: 0.2rem;
}

.ca-card-quality {
  margin-bottom: 0.75rem;
}

.ca-card-quality.verdict-kill {
  border-color: rgba(212, 43, 43, 0.45);
  background: rgba(212, 43, 43, 0.06);
}

.ca-card-quality.verdict-watch {
  border-color: rgba(255, 165, 0, 0.45);
  background: rgba(255, 165, 0, 0.06);
}

.ca-card-quality.verdict-ok {
  border-color: rgba(80, 200, 120, 0.35);
}

/* ── Card reviews & sentiment ─────────────────────────────── */
.ca-reviews {
  margin-bottom: 0.75rem;
  border-color: rgba(255, 81, 0, 0.22);
}

.ca-reviews h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.ca-reviews-lead {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
}

.ca-reviews-mood {
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ca-reviews-mood-good {
  border-color: rgba(46, 125, 50, 0.45);
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.12) 0%, rgba(46, 125, 50, 0.04) 100%);
}

.ca-reviews-mood-warn {
  border-color: rgba(212, 43, 43, 0.5);
  background: linear-gradient(135deg, rgba(212, 43, 43, 0.14) 0%, rgba(255, 81, 0, 0.06) 100%);
}

.ca-reviews-mood-mix {
  border-color: rgba(255, 165, 0, 0.45);
  background: linear-gradient(135deg, rgba(255, 165, 0, 0.12) 0%, rgba(255, 165, 0, 0.03) 100%);
}

.ca-reviews-mood-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.45rem;
}

.ca-reviews-mood-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--orange, #ff5100);
}

.ca-reviews-mood-warn .ca-reviews-mood-label {
  color: #d42b2b;
}

.ca-reviews-mood-good .ca-reviews-mood-label {
  color: #2e7d32;
}

.ca-reviews-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(212, 43, 43, 0.2);
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.ca-reviews-bar-pos {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2e7d32, #66bb6a);
}

.ca-reviews-mood-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.72rem;
}

.ca-reviews-stat-pos { color: #2e7d32; font-weight: 700; }
.ca-reviews-stat-neg { color: #d42b2b; font-weight: 700; }
.ca-reviews-stat-warn { color: #e65100; font-weight: 700; }

.ca-reviews-subtitle {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.45rem;
  opacity: 0.85;
}

.ca-reviews-subtitle-warn {
  color: #d42b2b;
}

.ca-reviews-problems {
  margin-bottom: 0.75rem;
}

.ca-reviews-problem-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ca-reviews-problem-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.ca-reviews-problem-tag em {
  font-style: normal;
  opacity: 0.75;
  font-weight: 800;
}

.ca-reviews-problem-tag.severity-critical {
  background: #ffebee;
  color: #b71c1c;
  border-color: rgba(183, 28, 28, 0.25);
}

.ca-reviews-problem-tag.severity-warn {
  background: #fff3e0;
  color: #e65100;
  border-color: rgba(230, 81, 0, 0.25);
}

.ca-reviews-problem-tag.severity-info {
  background: #e3f2fd;
  color: #1565c0;
  border-color: rgba(21, 101, 192, 0.2);
}

.ca-reviews-mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.ca-reviews-mp {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.ca-reviews-mp-warn {
  border-color: rgba(212, 43, 43, 0.4);
  background: rgba(212, 43, 43, 0.06);
}

.ca-reviews-mp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
}

.ca-reviews-mp-neg {
  color: #d42b2b;
  font-weight: 800;
  font-size: 0.72rem;
}

.ca-review-quote {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.55rem;
  border-left: 3px solid rgba(255, 255, 255, 0.15);
  font-size: 0.78rem;
  line-height: 1.4;
}

.ca-review-quote.is-positive {
  border-left-color: #2e7d32;
  background: rgba(46, 125, 50, 0.06);
}

.ca-review-quote.is-negative {
  border-left-color: #d42b2b;
  background: rgba(212, 43, 43, 0.08);
}

.ca-review-quote-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
  font-size: 0.7rem;
}

.ca-reviews-negative,
.ca-reviews-general {
  margin-top: 0.65rem;
}

.ca-review-stats-only {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
}

.article-card-blocks .ca-reviews,
.article-card-blocks .ca-mp-ratings,
.article-card-blocks .ca-reviews,
.article-card-blocks .ca-card-quality {
  margin-bottom: 0.65rem;
}

.ca-quality-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ca-quality-tip {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.ca-quality-tip-warn {
  border-color: rgba(212, 43, 43, 0.4);
  background: rgba(212, 43, 43, 0.08);
}

.ca-quality-mp {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  font-size: 0.68rem;
}

.ca-quality-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.ca-quality-body {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.ca-quality-body strong {
  display: block;
  font-weight: 600;
}

.ca-quality-body p.meta {
  margin: 0.25rem 0 0;
}

.ca-rec-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ca-rec {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  text-align: left;
  padding: 0.65rem 0.75rem;
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: default;
}

.ca-rec-icon {
  font-size: 1.1rem;
  line-height: 1.3;
}

.ca-month-chart {
  min-height: 180px;
  margin-bottom: 0.75rem;
}

.ca-month-table {
  font-size: 0.82rem;
}

/* ── Wow: keywords, tabs, popover, insights ───────────── */
.ca-kw-host {
  margin-bottom: 12px;
}

.kw-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.kw-bar-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray-mid);
  flex: 0 0 auto;
}

.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-chip {
  border: 1px solid #e8e8e8;
  background: #fff;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  animation: fadeUp 0.45s ease-out both;
}

.kw-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--orange);
}

.kw-chip-active {
  background: rgba(255, 81, 0, 0.12);
  border-color: var(--orange);
  color: var(--orange-dark);
}

.kw-cat { border-left: 3px solid #005bff; }
.kw-prod { border-left: 3px solid var(--orange); }
.kw-mp { border-left: 3px solid #2a9d52; }
.kw-qual { border-left: 3px solid #a020f0; }
.kw-risk { border-left: 3px solid #d42b2b; }

.ca-dynamics-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ca-dynamics-head .ca-chart-title {
  margin: 0;
}

.ca-dynamics-tabs {
  margin-bottom: 0;
}

.ca-dynamics-hint {
  margin: 0 0 8px;
}

.ca-dynamics-canvas {
  min-height: 220px;
}

.ca-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ca-tab {
  border: 1px solid #e5e5e5;
  background: #fafafa;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

.ca-tab:active {
  transform: scale(0.96);
}

.ca-tab:hover {
  border-color: var(--orange);
}

.ca-tab.active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.ca-tile {
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  font: inherit;
  color: inherit;
  width: 100%;
}

.ca-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: rgba(255, 81, 0, 0.35);
}

.ca-tile-pulse {
  animation: tilePulse 0.4s ease-out;
}

.ca-tile-hidden {
  display: none !important;
}

.ca-tile-reveal {
  animation: fadeUp 0.35s ease-out both;
}

.ca-tile-more {
  display: block;
  margin-top: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--orange);
  opacity: 0;
  transition: opacity 0.2s;
}

.ca-tile:hover .ca-tile-more {
  opacity: 1;
}

.ca-chart-detail-in span {
  color: var(--orange-dark);
  font-weight: 800;
}

.insight-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insight-card {
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #eee;
  background: #fff;
  font-size: 0.88rem;
  line-height: 1.45;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  animation: fadeUp 0.5s ease-out both;
}

.insight-card:hover {
  transform: translateX(4px);
  border-color: var(--orange);
}

.chart-hint {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: none;
  color: #aaa;
  letter-spacing: 0;
}

.period-chart-hint {
  margin: 6px 0 0;
  text-align: center;
}

.chart-interactive .chart-hint {
  display: inline-block;
  margin-left: 6px;
}

.chart-card .chart-hint {
  display: block;
  margin: 0 0 6px;
  padding: 0 12px;
}

.chart-card-active {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.np-popover {
  position: fixed;
  z-index: 12050;
  background: #fff;
  border: 1px solid #e5e5e5;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  padding: 14px 16px 12px;
  max-width: 340px;
  animation: fadeUp 0.25s ease-out;
}

.np-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12040;
  background: rgba(20, 20, 20, 0.18);
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

tbody tr.row-highlight-flash {
  animation: rowFlash 2s ease-out;
  outline: 2px solid var(--orange);
  outline-offset: -2px;
}

@keyframes rowFlash {
  0%, 40% { background: rgba(255, 81, 0, 0.14); }
  100% { background: transparent; }
}

.np-popover-in {
  animation: chartPop 0.12s cubic-bezier(0.22, 1, 0.36, 1);
}

.np-popover-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  color: #999;
}

.np-popover-body {
  font-size: 0.88rem;
  line-height: 1.45;
}

.np-popover-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--orange-dark);
  margin: 6px 0;
}

.np-popover-insight {
  max-width: 520px;
  padding: 18px 20px 16px;
}

.np-popover-insight .np-popover-body {
  font-size: 0.86rem;
}

.ca-insight-panel-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--orange-dark, #d9480f);
}

.ca-insight-lead {
  margin: 0 0 10px;
  line-height: 1.45;
}

.ca-insight-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.ca-insight-kpi {
  padding: 8px 10px;
  background: rgba(255, 81, 0, 0.06);
  border: 1px solid rgba(255, 81, 0, 0.15);
  text-align: center;
}

.ca-insight-kpi-label {
  display: block;
  font-size: 0.68rem;
  opacity: 0.75;
  margin-bottom: 2px;
}

.ca-insight-kpi strong {
  font-size: 0.92rem;
}

.ca-insight-compare,
.ca-insight-daily,
.ca-insight-supply {
  width: 100%;
  margin: 8px 0 10px;
  font-size: 0.78rem;
}

.ca-insight-section {
  margin-top: 12px;
}

.ca-insight-section strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
  color: var(--gray, #666);
}

.ca-insight-actions {
  margin: 0;
  padding-left: 18px;
  line-height: 1.45;
  font-size: 0.84rem;
}

.ca-insight-mp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ca-insight-mp-link {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ca-insight-mp-link:hover {
  border-color: var(--orange);
  color: var(--orange-dark);
}

.ca-insight-mp-link .meta {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.8;
}

.ca-insight-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.ca-insight-summary {
  margin: 8px 0 0;
}

.np-popover .btn {
  margin-top: 8px;
}

.leak-popover-type {
  font-weight: 600;
  margin: 0.35rem 0 0.5rem;
  color: var(--orange-dark, #d9480f);
}

.leak-popover-line {
  margin: 0.35rem 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.leak-popover-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.leak-popover-list li + li {
  margin-top: 0.55rem;
}

.leak-detail-foot {
  margin-top: 1rem;
}

/* ── Leaks: модель в таблице + боковая панель в модалке ── */
.leak-line-col {
  min-width: 200px;
  max-width: 280px;
  vertical-align: middle;
}

.leak-line-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.leak-line-pic {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.leak-line-pic-ph {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff5f0, #ffe8d6);
  color: var(--orange, #e85d04);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(232, 93, 4, 0.2);
}

.leak-line-text {
  min-width: 0;
  flex: 1;
}

.leak-line-primary {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.leak-line-secondary {
  font-size: 0.76rem;
  color: #888;
  margin-top: 3px;
  line-height: 1.3;
}

.leak-line-meta-col {
  font-size: 0.82rem;
  vertical-align: middle;
}

.leak-row-tag {
  display: inline-block;
  background: rgba(232, 93, 4, 0.1);
  color: #c2410c;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-right: 6px;
}

.leak-row-amt {
  font-weight: 700;
  color: var(--danger, #dc2626);
  white-space: nowrap;
}

.leak-detail-modal .article-modal-panel {
  width: min(960px, 94vw);
}

.leak-detail-modal .leak-modal-crumb {
  padding-bottom: 8px;
}

.leak-detail-modal .leak-modal-title {
  font-size: 1.05rem;
  margin: 4px 0 0;
  color: #666;
  font-weight: 600;
}

.leak-detail-split {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}

.leak-detail-aside {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  background: linear-gradient(180deg, #fffaf7 0%, #fff 100%);
  border: 1px solid rgba(232, 93, 4, 0.15);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(232, 93, 4, 0.08);
}

.leak-aside-pic {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eee;
  margin-bottom: 12px;
}

.leak-aside-pic-ph {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff5f0, #ffe8d6);
  color: var(--orange);
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.leak-aside-primary {
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.35;
  color: #111;
  margin-bottom: 4px;
}

.leak-aside-secondary {
  font-size: 0.82rem;
  color: #888;
  line-height: 1.3;
}

.leak-aside-full {
  font-size: 0.72rem;
  margin-top: 6px;
  line-height: 1.3;
}

.leak-aside-mp {
  margin: 12px 0 8px;
}

.leak-aside-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--danger, #dc2626);
  margin: 4px 0;
}

.leak-aside-type {
  font-size: 0.78rem;
  color: #c2410c;
  background: rgba(232, 93, 4, 0.1);
  padding: 4px 10px;
  border-radius: 8px;
  margin-top: 6px;
}

.leak-detail-main {
  min-width: 0;
}

@media (max-width: 720px) {
  .leak-detail-split {
    grid-template-columns: 1fr;
  }
  .leak-detail-aside {
    position: static;
    flex-direction: row;
    text-align: left;
    gap: 16px;
    align-items: center;
  }
  .leak-aside-pic,
  .leak-aside-pic-ph {
    width: 72px;
    height: 72px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
}

.leak-detail-hero {
  margin-bottom: 20px;
}

.leak-detail-title {
  margin: 12px 0 4px;
  font-size: 1.35rem;
}

.leak-detail-type {
  font-size: 1rem;
  margin: 8px 0 4px;
}

.leak-detail-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--danger, #dc2626);
  margin: 8px 0;
}

.leak-detail-owner {
  color: var(--orange);
  font-weight: 600;
  margin: 8px 0 0;
}

.leak-detail-section {
  margin: 16px 0;
  padding: 14px 16px;
}

.leak-detail-section h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b7280);
}

.leak-detail-action p {
  font-weight: 500;
}

.leak-mp-table,
.leak-sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.leak-mp-table th,
.leak-mp-table td,
.leak-sku-table th,
.leak-sku-table td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.leak-mp-table th,
.leak-sku-table th {
  background: #f9fafb;
}

.mp-badge-cell .mp-badge {
  min-width: 2.2rem;
  text-align: center;
}

.mp-badge.mp-total {
  background: #f3f4f6;
  color: #374151;
  border: 1px dashed #9ca3af;
  font-weight: 600;
}

tr.leak-mp-total td {
  background: #f9fafb;
  font-weight: 600;
  border-top: 1px solid #e5e7eb;
}

tr.leak-mp-split + tr.leak-mp-total td.firstcol {
  padding-left: 1.25rem;
}

.leak-mp-table td .mp-badge {
  min-width: 2.2rem;
  display: inline-block;
}

.leak-detail-foot {
  margin-top: 16px;
}

.leak-kill-detail .leak-detail-rating {
  font-size: 1.1rem;
  margin: 8px 0;
}

.leak-kill-stats {
  margin: 0;
  padding-left: 1.2rem;
}

.leak-kill-stats li {
  margin: 0.35rem 0;
}

.kill-mp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 12px;
}

@media (max-width: 960px) {
  .kill-mp-grid {
    grid-template-columns: 1fr;
  }
}

.kill-mp-block {
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
}

.kill-mp-block.verdict-kill {
  border-color: #fca5a5;
  background: #fff5f5;
}

.kill-mp-block.verdict-watch {
  border-color: #fcd34d;
  background: #fffbeb;
}

.kill-mp-block-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.kill-mp-verdict {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}

.verdict-kill .kill-mp-verdict {
  background: #fecaca;
  color: #991b1b;
}

.verdict-watch .kill-mp-verdict {
  background: #fef3c7;
  color: #92400e;
}

.verdict-ok .kill-mp-verdict {
  background: #d1fae5;
  color: #065f46;
}

.verdict-absent .kill-mp-verdict,
.verdict-unknown .kill-mp-verdict {
  background: #e5e7eb;
  color: #374151;
}

.kill-mp-photo {
  margin: 8px 0 12px;
  text-align: center;
}

.kill-mp-photo .thumb {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
}

.kill-detail-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.kill-hero-photo .thumb {
  max-width: 140px;
  max-height: 140px;
  object-fit: contain;
}

.kill-mp-row {
  margin: 6px 0;
  font-size: 0.92rem;
}

.kill-mp-stars .kill-stars {
  color: #f59e0b;
  letter-spacing: 1px;
}

.kill-mp-reason {
  margin: 10px 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.kill-mp-actions {
  margin: 10px 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

.kill-mp-actions li {
  margin: 4px 0;
}

.kill-mp-open {
  margin-top: 10px;
}

.leak-kpi-guidance {
  margin: 12px 0;
  padding: 16px 20px;
}

.leak-kpi-guidance-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.leak-kpi-guidance h3 {
  margin: 0;
  font-size: 1.05rem;
}

.leak-kpi-steps {
  margin: 12px 0 0;
  padding-left: 1.25rem;
}

.leak-kpi-step {
  margin: 0.5rem 0;
}

.leak-kpi-step strong {
  display: block;
}

.leak-calc-section {
  margin-top: 0;
}

.leak-calc-formula {
  margin: 0 0 8px;
  font-size: 0.88rem;
}

.leak-calc-bench {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.leak-calc-steps {
  margin: 0 0 14px;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.leak-calc-step + .leak-calc-step {
  margin-top: 0.55rem;
}

.leak-calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.leak-calc-table th,
.leak-calc-table td {
  border: 1px solid #e5e7eb;
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.leak-calc-table th {
  background: #f9fafb;
  font-size: 0.78rem;
}

.leak-calc-total-row td {
  background: #fff7ed;
  border-top: 2px solid #fdba74;
}

.leak-calc-margin {
  margin: 10px 0 0;
}

.kill-rec-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #e5e7eb;
}

.kill-rec-title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letterspacing: 0.05em;
  color: #6b7280;
}

.kill-rec-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kill-rec-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
}

.kill-rec-card:hover,
.kill-rec-card:focus-visible {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.kill-rec-priority {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1.5rem;
  text-align: center;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 700;
}

.verdict-kill .kill-rec-priority {
  background: #fecaca;
  color: #991b1b;
}

.kill-rec-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kill-rec-go {
  color: #9ca3af;
  font-weight: 700;
}

.kill-rec-flash,
.kill-mp-block .kill-rec-section.kill-rec-flash {
  animation: killRecFlash 1.2s ease-out;
}

@keyframes killRecFlash {
  0%, 100% { box-shadow: none; }
  30% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45); }
}

.kill-mp-block-hd {
  cursor: pointer;
}

.kill-mp-block-hd:hover .mp-badge {
  filter: brightness(0.95);
}

@keyframes tilePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.stat-card-wow {
  animation: chartPop 0.23s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.boot-error {
  margin-bottom: 12px;
  padding: 14px 16px;
  background: #fff5f0;
  border: 1px solid #ffc9a8;
  color: #8a2a00;
  font-size: 0.9rem;
}

.boot-error code {
  font-size: 0.85em;
}

.thumb-link {
  display: inline-block;
  border-radius: 5px;
  outline: 2px solid transparent;
  transition: outline-color 0.15s;
}

.thumb-link:hover {
  outline-color: var(--orange);
}

.thumb-link:hover .thumb {
  opacity: 0.88;
}

.mp-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  margin-right: 3px;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.mp-badge:hover {
  opacity: 0.8;
}

.mp-links-cell {
  line-height: 1.9;
}

.mp-link-cell {
  white-space: nowrap;
}

.mp-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.15s, transform 0.1s;
}

.mp-card-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.mp-card-miss {
  color: var(--gray-light);
  font-size: 0.85rem;
}

.mp-ym {
  background: #ffdb4d;
  color: #1a1a1a;
}

.mp-wb {
  background: #a020f0;
  color: #fff;
}

.mp-oz {
  background: #005bff;
  color: #fff;
}

.mp-other {
  background: #e0e0e0;
  color: #333;
}

.spark {
  display: inline-block;
  vertical-align: middle;
}

.spark-hit {
  fill: transparent;
  stroke: none;
  cursor: pointer;
}

.firstcol {
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 1;
  border-right: 1px solid #eee;
}

thead th.firstcol {
  z-index: 3;
  background: var(--orange);
  border-right-color: rgba(255, 255, 255, 0.15);
}

tbody tr:hover td.firstcol {
  background: var(--orange-soft);
}

tbody tr.grp td.firstcol {
  background: var(--orange-soft);
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--gray-mid);
}

.table-xscroll-compact .table-xscroll-bar {
  display: none !important;
}

.table-xscroll-compact .table-xscroll-pane {
  transform: none !important;
}

.table-xscroll-compact .table-xscroll-pane > table {
  width: 100%;
  max-width: 100%;
}

.spravochnik-table {
  width: 100%;
  table-layout: fixed;
}

.spravochnik-table thead th,
.spravochnik-table tbody td {
  white-space: normal;
}

.spravochnik-table .sprav-mp-col {
  width: 52px;
  text-align: center;
}

.spravochnik-table th[data-key="c1"],
.spravochnik-table td.t-text:not(.sprav-mp-col):not(.t-wrap) {
  width: 16%;
}

.spravochnik-table th[data-key="c3"],
.spravochnik-table td.t-wrap {
  width: auto;
}

.sprav-mp-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sprav-mp-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 9px;
}

.sprav-mp-logo-lg {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 10px;
}

.sprav-mp-grp-hd {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 14px !important;
  text-align: left !important;
  font-weight: 700;
  color: var(--orange-dark);
  background: var(--orange-soft) !important;
  border-top: 1px solid rgba(255, 81, 0, 0.2);
  border-bottom: 1px solid rgba(255, 81, 0, 0.2);
}

.sprav-mp-grp-hd span {
  margin-left: 10px;
}

.cell-wrap-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  white-space: normal;
  font-size: 0.82rem;
  color: var(--gray);
}

.cell-wrap-3:hover {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.spravochnik-table tbody td.t-wrap {
  vertical-align: top;
  text-align: left;
}

.foot-rows {
  padding: 8px 14px;
  color: var(--gray-mid);
  font-size: 0.78rem;
}

.k-down {
  color: #d42b2b !important;
}

.k-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-mid);
}

/* ── Columns panel ───────────────────────────────────────── */
.colspanel {
  position: fixed;
  top: 72px;
  right: 16px;
  width: 280px;
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  z-index: 50;
}

.colspanel label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.84rem;
  cursor: pointer;
}

.colspanel label:hover {
  background: var(--orange-soft);
}

.colspanel input[type="checkbox"] {
  accent-color: var(--orange);
}

/* ── Article modal ───────────────────────────────────────── */
body.modal-open {
  overflow: hidden;
}

.article-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow: auto;
}

.article-modal[hidden] {
  display: none !important;
}

.article-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 30, 0.45);
}

.article-modal-panel {
  position: relative;
  z-index: 1;
  width: min(1280px, 96vw);
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  margin-top: 8px;
}

.article-modal-header {
  position: sticky;
  top: 0;
  background: var(--white);
  border-bottom: 1px solid #eee;
  padding: 12px 20px 0;
  z-index: 2;
}

.article-modal-header #articleClose {
  float: none;
}

.article-modal-actions {
  float: right;
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.article-hero-stack {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 16px;
  padding: 0 4px 16px;
}

.article-hero-text {
  flex: 1 1 auto;
  min-width: 0;
}

.article-hero-media {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  align-self: stretch;
  min-width: 72px;
  max-width: min(38%, 160px);
}

.article-hero-grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 16px;
  padding-bottom: 16px;
}

.article-pic {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  min-height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid #eee;
}

.article-pic-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 100%;
  min-height: 56px;
  font-size: 1.75rem;
  color: #ccc;
  background: #f0f0f0;
  border: 1px solid #eee;
  border-radius: 8px;
}

.article-art {
  font-size: 0.8rem;
  color: var(--gray-mid);
  margin-bottom: 6px;
}

.article-title {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 800;
  color: var(--gray);
  line-height: 1.28;
  max-width: none;
}

.article-title-link {
  color: inherit;
  text-decoration: none;
}

.article-title-link:hover {
  color: var(--orange-dark, #e85d04);
}

.article-urgency {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.article-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 0.82rem;
  color: var(--gray-mid);
  margin-bottom: 10px;
}

.article-links {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.article-links .mp-icon-cell {
  min-width: 38px;
}

.article-links .mp-icon {
  width: 26px;
  height: 26px;
  font-size: 8px;
}

.article-links .mp-icon-price {
  font-size: 10px;
}

.focus-mp-prices {
  margin-top: 8px;
}

.focus-mp-prices .mp-icon-price {
  font-size: 10px;
}

.article-body {
  padding: 12px 16px 24px;
  flex: 1;
  overflow: auto;
}

.article-card-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.article-card-blocks .ca-mp-ratings,
.article-card-blocks .ca-card-quality {
  margin: 0;
}

.article-ack-bar {
  flex: 0 0 auto;
  padding: 14px 16px 18px;
  border-top: 2px solid var(--orange-soft);
  background: linear-gradient(to top, #fff 85%, var(--orange-soft));
}

.article-ack-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--gray-mid);
  line-height: 1.45;
}

.article-ack-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.article-ack-status {
  font-size: 0.88rem;
  font-weight: 700;
  color: #2a9d52;
}

.article-ack-status.is-done {
  padding: 8px 14px;
  border-radius: var(--radius);
  background: rgba(42, 157, 82, 0.1);
  border: 1px solid rgba(42, 157, 82, 0.25);
}

tbody tr.row-acked td {
  background: rgba(42, 157, 82, 0.06) !important;
}

.article-btn-acked {
  border-color: #2a9d52 !important;
  color: #2a9d52 !important;
}

.article-section {
  margin-bottom: 12px;
}

.promo-campaign-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ads-campaign-section {
  margin: 12px 0 16px;
  padding: 12px 14px;
}

.ads-campaign-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}

.ads-campaign-head h3 {
  margin: 0;
  font-size: 1rem;
}

.ads-campaign-table {
  font-size: 0.82rem;
}

.ads-cabinet-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.live-cabinet-section {
  margin: 10px 0 12px;
  padding: 14px 16px 10px;
}

.live-cabinet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.live-cabinet-head h3 {
  margin: 0;
  font-size: 1rem;
}

.live-cabinet-filters {
  margin-bottom: 0;
}

.ads-cabinet-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 7px;
  background: #fff;
  color: var(--gray, #333);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.15;
}

.ads-cabinet-chip b {
  color: var(--orange-dark, #e85d04);
  font-weight: 800;
}

.ads-cabinet-chip em {
  color: var(--gray-mid, #666);
  font-style: normal;
  font-size: 0.74rem;
}

.ads-cabinet-chip.active {
  border-color: var(--orange, #ff7a1a);
  background: rgba(255, 122, 26, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.14);
}

.ads-rec-badge {
  display: inline-flex;
  align-items: center;
  max-width: 150px;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: normal;
}

.ads-rec-critical {
  color: #991b1b;
  background: #fee2e2;
}

.ads-rec-warn {
  color: #8a4b00;
  background: #fff1c7;
}

.ads-rec-good {
  color: #11613a;
  background: #dcfce7;
}

.ads-rec-info {
  color: #334155;
  background: #e9eef5;
}

.ads-rec-section {
  padding: 10px 12px;
  border-radius: 8px;
}

.ads-rec-section h3 {
  margin-top: 0;
}

.ads-rec-section ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.ads-sku-table td:first-child {
  font-weight: 800;
}

.ads-probe-wrap {
  margin: 0 0 10px;
  padding: 8px 10px;
  background: #fff8e6;
  border: 1px solid rgba(200, 140, 0, 0.25);
  border-radius: 6px;
  font-size: 0.82rem;
}

.ads-probe-note {
  margin: 4px 0;
}

.ads-sku-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  opacity: 0.85;
}

.ads-modal-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ads-modal-kpi {
  padding: 8px 10px;
  background: #f7f7f8;
  border-radius: 6px;
}

.ads-modal-kpi .lbl {
  display: block;
  font-size: 0.72rem;
  color: #666;
}

.ads-modal-chart {
  position: relative;
  min-height: 240px;
  height: clamp(240px, 36vh, 360px);
  margin-top: 8px;
}

.ads-modal-chart canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.promo-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff7f2;
  border: 1px solid rgba(255, 81, 0, 0.15);
  font-size: 0.78rem;
  color: #555;
}

.promo-chip-bad {
  background: #fff5f5;
  border-color: rgba(212, 43, 43, 0.25);
  color: #a02020;
}

.article-section h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--orange-dark);
  border-bottom: 2px solid var(--orange-soft);
  padding-bottom: 6px;
}

.article-md p,
.article-section p {
  margin: 0 0 10px;
  line-height: 1.6;
  font-size: 0.9rem;
}

.article-md strong,
.article-section .article-md strong,
.sab-facts strong,
.ca-insight-lead strong,
.insight-card strong {
  font-weight: 700;
  color: var(--gray);
}

.article-section ul,
.article-section ol {
  margin: 0 0 10px 18px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.article-chart {
  margin: 8px 0 12px;
}

.article-table {
  width: 100%;
  font-size: 0.82rem;
  margin-top: 8px;
}

.article-table th {
  background: var(--orange-soft);
  color: var(--gray);
  text-align: left;
  padding: 8px;
}

.article-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

tbody tr.row-clickable {
  cursor: pointer;
}

tbody tr.row-clickable:hover td {
  background: var(--orange-soft);
  outline: 1px solid rgba(255, 81, 0, 0.15);
}

/* ── Charts & wow animations ─────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes navSlide {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes rowFade {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes kpiGlow {
  0% {
    box-shadow: 0 0 0 rgba(255, 81, 0, 0);
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 81, 0, 0.12);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes pageIn {
  from {
    opacity: 0.6;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chartPop {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.955);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes tableSpinner {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tableShimmer {
  100% {
    transform: translateX(100%);
  }
}

.animate-in {
  animation: fadeUp 0.7s ease-out both;
}

.chart-card.animate-in {
  animation: chartPop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.nav-enter {
  animation: navSlide 0.5s ease-out both;
}

.row-enter {
  animation: rowFade 0.45s ease-out both;
}

.main.page-enter {
  animation: pageIn 0.16s ease-out;
}

.kpi.animate-in {
  animation: fadeUp 0.6s ease-out both, kpiGlow 1.2s ease-out 0.3s;
}

.viz-panel {
  margin-bottom: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Графики на всю ширину контента */
.viz-panel > .viz-grid,
.viz-panel > .period-chart-wrap,
.viz-panel > .chart-wrap,
.ir-kpi-chart-wrap,
.ir-kpi-chart,
.ca-chart-wrap,
.dashboard-focus-charts {
  width: 100%;
  box-sizing: border-box;
}

/* ── Insights radar ─────────────────────────────────────── */
.view-back-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  background: linear-gradient(180deg, #fff8f3 0%, #fff 100%);
  border: 2px solid rgba(255, 81, 0, 0.35);
  box-shadow: 0 4px 14px rgba(255, 81, 0, 0.1);
}

.view-back-bar[hidden] {
  display: none !important;
}

.btn-back {
  flex: 0 0 auto;
  font-size: 1rem;
  font-weight: 800;
  padding: 11px 22px;
  border-radius: var(--radius);
  background: var(--orange);
  color: #fff;
  border: none;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(255, 81, 0, 0.35);
}

.btn-back:hover {
  background: var(--orange-dark);
}

.view-back-label {
  flex: 1 1 auto;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray);
  line-height: 1.35;
}

.insights-radar-wrap {
  margin-bottom: 12px;
}

.insights-radar {
  padding: 16px 18px;
  background: linear-gradient(135deg, #fff 0%, #fffaf7 100%);
  border: 1px solid rgba(255, 81, 0, 0.12);
}

.insights-radar.ir-enter {
  animation: chartPop 0.23s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ir-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}

.ir-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--orange-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ir-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 rgba(255, 81, 0, 0.5);
  animation: irPulse 1.8s ease-out infinite;
}

@keyframes irPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 81, 0, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(255, 81, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 81, 0, 0); }
}

.ir-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--gray-mid);
}

.ir-meta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray);
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #eee;
}

.ir-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ir-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid #eee;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  animation: fadeUp 0.5s ease-out both;
}

.ir-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.ir-card-active {
  animation: tilePulse 0.35s ease-out;
}

.ir-card-icon {
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.ir-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #555;
}

.ir-card-body strong {
  font-size: 0.88rem;
  color: var(--gray);
}

.ir-card-go {
  color: var(--orange);
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.2s;
}

.ir-card:hover .ir-card-go {
  opacity: 1;
}

.supply-sku-list-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.supply-sku-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #eee;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.supply-sku-row:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.supply-sku-pic {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 4px;
  background: #fafafa;
}

.supply-sku-ph {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: #f5f5f5;
  border-radius: 4px;
}

.supply-sku-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.supply-sku-body strong {
  font-size: 0.88rem;
  color: var(--gray);
}

.supply-sku-meta {
  font-size: 0.78rem;
  color: #666;
}

.supply-sku-go {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange);
  white-space: nowrap;
}

.ir-critical { border-left: 4px solid #d42b2b; }
.ir-high { border-left: 4px solid #ff5100; }
.ir-warn { border-left: 4px solid #f5a623; }
.ir-good { border-left: 4px solid #2a9d52; }
.ir-info { border-left: 4px solid #005bff; }

.ir-focus-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
}

.ir-focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.ir-focus-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #eee;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
  animation: fadeUp 0.45s ease-out both;
}

.ir-focus-card:hover {
  transform: translateX(4px);
  border-color: var(--orange);
}

.ir-focus-pic {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: #fafafa;
  flex: 0 0 auto;
}

.ir-focus-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.ir-focus-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ir-focus-text strong {
  font-size: 0.8rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ir-focus-name {
  display: block;
  color: var(--gray);
  font-weight: 700;
}

.ir-focus-art {
  font-size: 0.68rem;
  color: #aaa;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ir-focus-sub {
  font-size: 0.68rem;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ir-focus-open {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--orange);
  flex: 0 0 auto;
}

.ir-kpi-chart {
  padding: 12px 14px;
  margin-top: 4px;
}

.ir-kpi-chart-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gray);
}

.ir-kpi-canvas {
  height: 240px;
  position: relative;
}

.ir-kpi-canvas canvas {
  max-height: 240px;
}

/* План поставок — полноширинный блок с фото, KPI и сеткой складов */
.supply-ai-panel-wrap {
  margin: 0 0 16px;
}

.supply-ai-panel {
  border: 2px solid var(--orange, #ff5100);
  background: linear-gradient(135deg, #fffaf7 0%, #fff 48%, #f8fbff 100%);
  padding: 18px 20px;
  animation: fadeInUp 0.35s ease;
}

.supply-ai-panel.sab-urgent {
  border-color: #d42b2b;
  background: linear-gradient(135deg, #fff5f5 0%, #fff 50%, #fffaf7 100%);
}

.supply-ai-panel.sab-soon {
  border-color: #e86a00;
  background: linear-gradient(135deg, #fff8f2 0%, #fff 55%, #fffaf7 100%);
}

.supply-ai-panel.sab-stop {
  border-color: #5b8def;
  background: linear-gradient(135deg, #f5f8ff 0%, #fff 55%, #fafafa 100%);
}

.sab-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px 20px;
  align-items: start;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 900px) {
  .sab-hero {
    grid-template-columns: auto 1fr;
  }
  .sab-kpi-strip {
    grid-column: 1 / -1;
  }
}

.sab-hero-photo {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  overflow: hidden;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
}

.sab-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sab-hero-photo-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #bbb;
}

.sab-hero-main {
  min-width: 0;
}

.sab-hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.sab-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-mid, #666);
}

.sab-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 4px;
  background: rgba(255, 81, 0, 0.14);
  color: #c43d00;
  white-space: nowrap;
}

.sab-urgent .sab-badge { background: rgba(212, 43, 43, 0.15); color: #a01818; }
.sab-soon .sab-badge { background: rgba(232, 106, 0, 0.14); color: #b84e00; }
.sab-stop .sab-badge { background: rgba(91, 141, 239, 0.14); color: #2a5db8; }

.sab-product-name {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 2px;
}

.sab-product-art {
  font-size: 0.82rem;
  color: #777;
  margin-bottom: 8px;
}

.sab-verdict-line {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: #1a1a1a;
}

.sab-urgent .sab-verdict-line { color: #a01818; }
.sab-soon .sab-verdict-line { color: #b84e00; }

.sab-kpi-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-self: stretch;
}

.sab-kpi {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 88px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  text-align: center;
}

.sab-kpi-accent { border-color: rgba(255, 81, 0, 0.35); background: #fffaf7; }
.sab-kpi-warn { border-color: rgba(232, 106, 0, 0.4); background: #fff8f2; }
.sab-kpi-danger { border-color: rgba(212, 43, 43, 0.35); background: #fff5f5; }

.sab-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: #1a1a1a;
}

.sab-kpi-danger .sab-kpi-val { color: #a01818; }
.sab-kpi-accent .sab-kpi-val { color: #c43d00; }

.sab-kpi-unit {
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 2px;
  color: #888;
}

.sab-kpi-lbl {
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}

.sab-section {
  margin-bottom: 16px;
}

.sab-section:last-child {
  margin-bottom: 0;
}

.sab-section-title {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-mid, #666);
}

.sab-signal {
  padding: 14px 16px;
  background: #f4f4f4;
  border-left: 4px solid #888;
  border-radius: 0 6px 6px 0;
}

.sab-facts {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #333;
}

.sab-facts li {
  margin-bottom: 6px;
}

.sab-facts li:last-child {
  margin-bottom: 0;
}

.sab-facts strong {
  font-weight: 700;
}

.sab-action {
  padding: 14px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sab-step-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.sab-step-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-left: 3px solid var(--orange, #ff5100);
}

.sab-urgent .sab-step-card { border-left-color: #d42b2b; }
.sab-soon .sab-step-card { border-left-color: #e86a00; }
.sab-stop .sab-step-card { border-left-color: #5b8def; }

.sab-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--orange, #ff5100);
  border-radius: 4px;
}

.sab-urgent .sab-step-num { background: #d42b2b; }
.sab-soon .sab-step-num { background: #e86a00; }
.sab-stop .sab-step-num { background: #5b8def; }

.sab-step-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #222;
}

.sab-mp-plans {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sab-mp-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--orange, #ff5100);
}

.sab-urgent .sab-mp-title { color: #d42b2b; }

.sab-wh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.sab-wh-card {
  padding: 12px 14px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
}

.sab-wh-name {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
  color: #222;
  margin-bottom: 6px;
}

.sab-wh-qty {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--orange, #ff5100);
  line-height: 1;
}

.sab-urgent .sab-wh-qty { color: #d42b2b; }

.sab-wh-qty span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #888;
  margin-left: 3px;
}

.sab-wh-hint {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #777;
}

.table-toolbar {
  display: block;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-left: 4px solid var(--orange, #ff5100);
  background: linear-gradient(180deg, #fffaf7 0%, #fff 100%);
}

.table-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.table-filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-mid, #666);
}

.table-cat-select {
  min-width: 160px;
  max-width: 240px;
}

.stock-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding-left: 4px;
  border-left: 1px solid #eee;
}

.stock-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gray, #333);
  cursor: pointer;
  user-select: none;
}

.stock-filter-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--orange, #ff5100);
  cursor: pointer;
}

.table-filter-meta {
  white-space: nowrap;
}

.table-compact-msg {
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(180deg, #fffaf7 0%, #fff 100%);
  border: 1px dashed rgba(255, 81, 0, 0.25);
}

.table-compact-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.table-compact-msg p {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.table-compact-btn {
  margin-top: 8px;
}

/* ── Category filter ─────────────────────────────────────── */
.category-bar {
  margin-bottom: 12px;
  padding: 10px 14px;
}

.cat-filter-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cat-filter-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray);
}

.cat-select {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 7px 12px;
  border: 1px solid #ddd;
  background: #fff;
  min-width: 180px;
  max-width: 280px;
}

.cat-filter-meta {
  font-size: 0.78rem;
  color: #888;
  margin-left: auto;
}

tr.cat-grp td.cat-grp-hd {
  background: linear-gradient(90deg, rgba(232, 93, 4, 0.12), rgba(232, 93, 4, 0.03));
  color: var(--orange, #e85d04);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  padding: 10px 14px;
  border-top: 2px solid rgba(232, 93, 4, 0.35);
  border-bottom: 1px solid rgba(232, 93, 4, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
}

.cat-grp-pic {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  background: #fff;
}

.cat-grp-ph {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f0f0f0, #e4e4e4);
  flex-shrink: 0;
  display: inline-block;
}

.viz-grid.viz-insights {
  margin-top: 12px;
  grid-template-columns: 1fr 1fr;
}

/* ── Period bar (Metrika-style) ───────────────────────────── */
.period-bar {
  margin-bottom: 12px;
  padding: 12px 14px 10px;
}

.period-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.period-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.period-presets {
  gap: 6px;
}

.period-preset,
.period-group {
  border: 1px solid #e0e0e0;
  background: #fff;
  color: var(--gray);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.period-preset:hover,
.period-group:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.period-preset.is-active,
.period-group.is-active {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.period-main {
  justify-content: space-between;
}

.period-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.period-date-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 6px;
}

.period-date-lbl input[type="date"] {
  font-family: inherit;
  font-size: 0.78rem;
  padding: 5px 8px;
  border: 1px solid #ddd;
}

.period-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.period-select {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid #ddd;
  background: #fff;
  min-width: 140px;
}

.period-groups {
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
}

.period-chart-slot {
  min-height: 240px;
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
}

.period-chart-wrap {
  min-height: 320px;
}

.period-chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.period-chart-total {
  font-size: 0.9rem;
  color: var(--gray);
}

.period-chart-total strong {
  color: var(--orange);
  font-size: 1.1rem;
}

.period-chart-sub {
  font-size: 0.75rem;
  color: #999;
}

.period-loading,
.period-empty,
.period-error {
  padding: 48px 16px;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
}

.period-error {
  color: var(--red, #d42b2b);
}

.viz-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
}

.viz-grid.viz-single {
  grid-template-columns: 1fr;
}

.viz-grid.viz-matrix2 {
  grid-template-columns: minmax(0, 1fr);
}

.viz-grid.viz-matrix2 .chart-title {
  text-wrap: balance;
}

.viz-grid.viz-matrix2 .chart-wrap,
.viz-grid.viz-matrix2 canvas {
  min-width: 0;
}

.viz-grid.viz-opiu-bar {
  margin-bottom: 16px;
}

.viz-grid.viz-opiu-donut {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.viz-grid.viz-wide {
  grid-template-columns: 1fr;
}

.viz-grid.viz-triple {
  grid-template-columns: 1fr 1fr;
}

.viz-grid.viz-ads-sku,
.viz-grid.viz-ads-live,
.viz-grid.viz-ads-compare {
  margin-bottom: 0;
}

.viz-grid.viz-ads-live {
  margin-top: 16px;
}

.viz-grid.viz-ads-compare {
  margin-top: 16px;
}

.viz-grid.viz-quad {
  grid-template-columns: 1fr 1fr;
}

.viz-grid.viz-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.viz-grid.viz-four .chart-card {
  min-height: 320px;
  padding: 14px 12px 10px;
}

.viz-grid.viz-four .chart-wrap {
  min-height: 240px;
}

.viz-grid.viz-four .chart-wrap canvas {
  min-height: 220px !important;
}

.viz-panel .chart-card.is-hbar .chart-wrap {
  flex: 1 1 auto;
}

.viz-panel .chart-card.is-hbar .chart-wrap canvas {
  display: block;
  min-height: 240px !important;
}

.viz-panel .chart-card:hover {
  transform: none;
}

.chart-card {
  background: var(--white);
  border: 1px solid #eee;
  box-shadow: var(--shadow);
  padding: 18px 20px 14px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.chart-card.is-empty {
  min-height: 0;
  padding-bottom: 10px;
}

.chart-card.is-empty .chart-wrap {
  flex: 0 0 auto;
  min-height: 0;
}

.chart-card.is-empty .chart-wrap canvas {
  min-height: 0 !important;
}

.viz-grid-all-empty {
  display: none !important;
}

.chart-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 81, 0, 0.18);
  box-shadow: 0 14px 36px rgba(255, 81, 0, 0.14);
}

.chart-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-title-drill {
  cursor: pointer;
  transition: color 0.15s ease;
}

.chart-title-drill:hover,
.chart-title-drill:focus-visible {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.chart-title-arrow {
  display: inline;
  margin-left: 6px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: #aaa;
}

.chart-title-drill:hover .chart-title-arrow,
.chart-title-drill:focus-visible .chart-title-arrow {
  color: var(--orange);
}

.chart-desc {
  margin: -2px 0 12px;
  display: grid;
  gap: 4px;
  color: #5f5f5f;
  font-size: 0.82rem;
  line-height: 1.35;
}

.chart-desc strong {
  color: #2f2f2f;
  font-weight: 800;
}

.chart-desc-click {
  color: #8a4b16;
}

.chart-wrap {
  position: relative;
  flex: 1;
  min-height: 300px;
}

.chart-wrap canvas {
  min-height: 280px !important;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.chart-card:hover .chart-wrap canvas {
  transform: translateY(-1px) scale(1.01);
  filter: saturate(1.03);
}

.chart-empty-note {
  margin: 0;
  padding: 12px 10px;
  text-align: center;
  line-height: 1.45;
  font-size: 0.78rem;
}

.pv-sku-focus {
  padding: 4px 0;
}

.pv-sku-focus-name {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
  line-height: 1.35;
}

.pv-sku-focus-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.pv-sku-focus-table th,
.pv-sku-focus-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  text-align: left;
  vertical-align: top;
}

.pv-sku-focus-table th {
  width: 38%;
  color: var(--gray);
  font-weight: 700;
}

.article-chart-lg {
  min-height: 220px;
}

.article-chart-md {
  min-height: 200px;
  margin-top: 12px;
}

.article-modal {
  opacity: 0;
  transition: opacity 0.28s ease;
}

.article-modal.modal-visible {
  opacity: 1;
}

.article-modal-panel {
  transform: translateY(24px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-modal.modal-visible .article-modal-panel {
  transform: translateY(0) scale(1);
}

.article-pic {
  animation: fadeUp 0.5s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .animate-in,
  .chart-card.animate-in,
  .nav-enter,
  .row-enter,
  .main.page-enter,
  .kpi.animate-in,
  .article-modal,
  .article-modal-panel {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

@media (max-width: 900px) {
  .viz-grid,
  .viz-grid.viz-triple,
  .viz-grid.viz-quad,
  .viz-grid.viz-four,
  .viz-grid.viz-insights {
    grid-template-columns: 1fr;
  }

  .cat-filter-meta {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .ca-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .article-hero-stack {
    gap: 10px;
  }

  .article-hero-media {
    max-width: 96px;
    min-width: 64px;
  }

  .article-pic-placeholder {
    width: 64px;
    font-size: 1.4rem;
  }

  .article-modal-header {
    padding: 10px 12px 0;
  }
}

@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
    padding-left: 0;
  }

  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    position: static;
    left: auto;
    top: auto;
    bottom: auto;
    height: auto;
    max-height: 38vh;
    align-self: stretch;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .site-header h1 {
    font-size: 0.9rem;
  }
}

.restock-dual-tables {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 8px;
}

.restock-table-block {
  padding: 0;
  overflow: hidden;
}

.restock-table-head {
  padding: 16px 18px 8px;
  border-bottom: 1px solid var(--border, #eee);
}

.restock-table-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}

.restock-table-sub {
  margin: 0;
  font-size: 0.82rem;
}

.restock-table-scroll {
  max-height: 520px;
  overflow: auto;
}

.restock-viz-section-title {
  margin: 20px 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted, #555);
}

.viz-panel .restock-viz-section-title:first-child {
  margin-top: 0;
}

.funnel-monthly-section {
  margin-bottom: 18px;
}

.viz-grid.viz-funnel-monthly {
  margin-bottom: 8px;
}

.restock-sup-cat-wrap {
  margin-top: 12px;
}

/* ——— Прогноз поставок: FBS hub ——— */
.prognoz-hub-wrap {
  margin: 12px 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.prognoz-hub {
  padding: 18px 20px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.ph-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ph-horizon-badge {
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--orange);
  background: rgba(255, 81, 0, 0.1);
  border: 1px solid rgba(255, 81, 0, 0.35);
  white-space: nowrap;
}

.ph-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 800;
}

.ph-sub {
  margin: 0;
  line-height: 1.45;
}

.ph-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 0;
  min-width: 0;
  max-width: 100%;
}

.ph-kpi {
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid #eee;
}

.ph-kpi-val {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange);
}

.ph-kpi-val small {
  font-size: 0.65em;
  font-weight: 600;
  margin-left: 4px;
  color: var(--gray);
}

.ph-kpi-lbl {
  display: block;
  font-weight: 700;
  margin-top: 4px;
}

.ph-kpi-hint {
  display: block;
  font-size: 0.78rem;
  margin-top: 4px;
}

.ph-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ph-filter-btn {
  border: 1px solid #ddd;
  background: var(--white);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.ph-filter-btn.active {
  border-color: var(--orange);
  background: rgba(255, 81, 0, 0.08);
  color: var(--orange);
}

.ph-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ph-action {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  cursor: pointer;
}

.ph-action.ph-sev-crit {
  border-left: 4px solid var(--red, #d42b2b);
}

.ph-action.ph-sev-high {
  border-left: 4px solid var(--orange);
}

.ph-action.ph-sev-warn {
  border-left: 4px solid #f5a623;
}

.ph-action-pic {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
  background: #fafafa;
}

.ph-action-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.ph-action-title {
  margin: 0 0 6px;
  font-size: 0.92rem;
}

.ph-action-text {
  margin: 0 0 8px;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #444;
}

.ph-action-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
}

.ph-action-qty {
  font-weight: 800;
  color: var(--orange);
}

.ph-table-section {
  margin-top: 8px;
}

.ph-table-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
}

.ph-stock-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.ph-stock-table th,
.ph-stock-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.ph-st-name strong {
  display: block;
}

.ph-empty {
  padding: 16px;
  text-align: center;
}

.ph-tree-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ddd;
}

@media (max-width: 900px) {
  .ph-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .ph-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ——— Прогноз: карта + рекомендации ——— */
.ph-main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.ph-main-layout > * {
  min-width: 0;
  max-width: 100%;
}

.ph-map-wrap {
  background: linear-gradient(145deg, #121820 0%, #0a0e14 100%);
  border-radius: 12px;
  padding: 14px 16px 12px;
  border: 1px solid rgba(234, 88, 12, 0.25);
  width: 100%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  min-width: 0;
  overflow: hidden;
}

.ph-map-head {
  margin-bottom: 8px;
}

.ph-map-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #f5f7fa;
}

.ph-map-sub {
  margin: 0;
  color: #9aa8b8 !important;
  font-size: 0.78rem;
}

.ph-map-viewport-wrap {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.ph-map-viewport-wrap.ph-map-pannable {
  cursor: grab;
  touch-action: none;
}

.ph-map-viewport-wrap.ph-map-panning {
  cursor: grabbing;
}

.ph-map-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ph-map-zoom-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 20, 25, 0.85);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ph-map-zoom-btn:hover {
  background: rgba(255, 81, 0, 0.9);
  border-color: #ff5100;
}

.ph-map-zoom-reset {
  font-size: 0.65rem;
  font-weight: 700;
}

.ph-map-body {
  fill: url(#phLandGrad);
  stroke: #802800;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ph-map-extra {
  fill: url(#phLandGrad);
  fill-opacity: 0.94;
  stroke: #662000;
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.ph-map-novorossiya {
  fill: url(#phLandGrad);
  fill-opacity: 0.9;
  stroke: #802800;
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.ph-map-crimea {
  fill: url(#phLandGrad);
  fill-opacity: 0.92;
  stroke: #802800;
  stroke-width: 1.2;
}

.ph-map-region {
  fill: none;
  stroke: rgba(120, 50, 20, 0.28);
  stroke-width: 0.9;
  stroke-dasharray: 4 6;
  pointer-events: none;
}

.ph-map-rec-ring {
  fill: none;
  stroke: rgba(255, 81, 0, 0.5);
  stroke-width: 1.5;
  pointer-events: none;
}

.ph-map-wrap:not(.ph-map-is-zoomed) .ph-wh-moscow .ph-map-label-wh {
  font-size: 7px;
}

.ph-map-land {
  fill: #3d2817;
  stroke: #b45309;
  stroke-width: 0.6;
  opacity: 0.95;
}

.ph-map-city circle {
  fill: #fef3c7;
  stroke: #fff;
  stroke-width: 1;
}

.ph-map-city text {
  font-size: 9px;
  fill: #1a3350;
  font-weight: 700;
  font-family: Manrope, sans-serif;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5px;
  stroke-linejoin: round;
}

.ph-map-label-wh {
  font-size: 8px;
  font-weight: 700;
  fill: #f8fafc;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 2px;
}

.ph-map-label-mp {
  font-size: 7px;
  fill: #cbd5e1;
  font-weight: 600;
}

.ph-map-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  max-width: 100%;
  aspect-ratio: 1000 / 600;
  touch-action: none;
  user-select: none;
}

.ph-map-extra-group {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.ph-map-land-group {
  filter: drop-shadow(0 3px 8px rgba(234, 88, 12, 0.15));
}

.fh-map-viewport-wrap .ph-map-zoom-btn {
  background: rgba(255, 255, 255, 0.92);
  color: #9a3412;
  border-color: #fdba74;
}

.fh-map-body {
  fill: url(#fhLandGrad);
  stroke: #802800;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.fh-map-extra {
  fill: url(#fhLandGrad);
  fill-opacity: 0.94;
  stroke: #662000;
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.fh-map-novorossiya {
  fill: url(#fhLandGrad);
  fill-opacity: 0.9;
  stroke: #802800;
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.fh-map-crimea {
  fill: url(#fhLandGrad);
  fill-opacity: 0.92;
  stroke: #802800;
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.fh-city circle {
  fill: #9a3412;
}

.fh-city text {
  fill: #7c2d12;
  font-size: 8px;
  font-weight: 700;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 3px;
  stroke-linejoin: round;
}

/* Obukhovo PATRIOT hub */
.ph-hub-obukhovo-g {
  pointer-events: none;
}

.ph-hub-obukhovo-glow {
  fill: rgba(255, 81, 0, 0.35);
  transform-box: fill-box;
  transform-origin: center;
  animation: ph-hub-pulse 2.2s ease-in-out infinite;
}

.ph-hub-obukhovo {
  fill: #ff5100;
  stroke: #fff;
  stroke-width: 2.5;
  filter: url(#phHubGlow);
}

.ph-hub-obukhovo-p {
  font-size: 18px;
  font-weight: 900;
  font-style: italic;
  fill: #fff;
  pointer-events: none;
  font-family: Manrope, sans-serif;
}

.ph-hub-obukhovo-label-halo,
.fh-hub-obukhovo-label-halo {
  font-size: 10px;
  font-weight: 800;
  fill: none;
  stroke: #ffffff;
  stroke-width: 6;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
  font-family: Manrope, sans-serif;
}

.ph-hub-obukhovo-label,
.fh-hub-obukhovo-label {
  font-size: 10px;
  font-weight: 800;
  fill: #ff5100;
  paint-order: stroke fill;
  stroke: #ffffff;
  stroke-width: 5;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: none;
  font-family: Manrope, sans-serif;
}

@keyframes ph-hub-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.18); }
}

/* Shipping arc routes from Obukhovo */
.ph-ship-routes,
.fh-ship-routes {
  pointer-events: none;
}

.ph-ship-arc,
.fh-ship-arc {
  fill: none;
  stroke: #ff5100;
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.22;
  transition: opacity 0.32s ease, stroke-width 0.32s ease;
}

.ph-ship-arc.ph-mp-hidden,
.fh-ship-arc.ph-mp-hidden {
  opacity: 0 !important;
  stroke-width: 0.5;
}

.ph-ship-arc-1 { stroke: #ffb380; opacity: 0.18; }
.ph-ship-arc-2 { stroke: #ff5100; opacity: 0.28; stroke-width: 1.6; }

.fh-ship-arc {
  stroke: #ea580c;
  opacity: 0.28;
}

.fh-ship-arc-1 { stroke: #fb923c; opacity: 0.22; }
.fh-ship-arc-2 { stroke: #fdba74; opacity: 0.32; }

.ph-ship-active,
.fh-ship-active {
  pointer-events: none;
}

.ph-ship-comet,
.fh-ship-comet {
  pointer-events: none;
}

.ph-ship-tail,
.fh-ship-tail {
  stroke-width: 3.2;
  stroke-linecap: round;
  opacity: 0.85;
}

.ph-ship-head,
.fh-ship-head {
  fill: #fff;
  stroke: #ff5100;
  stroke-width: 1.6;
}

.fh-ship-head {
  stroke: #ea580c;
}

.ph-ship-arrive,
.fh-ship-arrive {
  animation: ph-ship-arrive 0.5s ease-out;
}

@keyframes ph-ship-arrive {
  0% { filter: drop-shadow(0 0 0 rgba(255, 81, 0, 0)); }
  40% { filter: drop-shadow(0 0 8px rgba(255, 81, 0, 0.95)); stroke-width: 3; }
  100% { filter: drop-shadow(0 0 2px rgba(255, 81, 0, 0.35)); }
}

@media (prefers-reduced-motion: reduce) {
  .ph-ship-active,
  .fh-ship-active {
    display: none;
  }
}

.ph-leg-hub { color: #ff5100; font-weight: 800; }
.ph-leg-ship { color: #ffb380; }

.ph-main-top {
  margin-bottom: 0;
}

.ph-map-marker {
  fill: #555;
  stroke: #fff;
  stroke-width: 2.5;
  cursor: pointer;
  transition: r 0.15s ease, fill 0.15s ease;
}

.ph-map-mp-wb { fill: #7c3aed; }
.ph-map-mp-ozon { fill: #005bff; }
.ph-map-mp-ym { fill: #facc15; stroke: #fff; }

.ph-map-has-recs {
  stroke-width: 2.5;
  filter: drop-shadow(0 0 4px rgba(255, 81, 0, 0.55));
}

.ph-map-marker-selected .ph-map-marker {
  stroke: var(--orange);
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(255, 81, 0, 0.8));
}

.ph-map-marker-g {
  cursor: pointer;
  outline: none;
}

.ph-map-marker-g:focus-visible circle {
  stroke: var(--orange);
  stroke-width: 3;
}

.ph-map-badge {
  font-size: 9px;
  font-weight: 800;
  fill: #fff;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
}

.ph-map-label {
  font-size: 9px;
  fill: #b8c4d0;
  pointer-events: none;
  font-family: Manrope, sans-serif;
}

.ph-map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: #9aa8b8;
}

.ph-leg-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  transition: opacity 0.2s ease;
}

.ph-leg-filter .ph-mp-filter-cb {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: currentColor;
  cursor: pointer;
  flex-shrink: 0;
}

.ph-leg-filter .ph-leg-dot {
  line-height: 1;
}

.ph-leg-filter:has(.ph-mp-filter-cb:not(:checked)) {
  opacity: 0.55;
}

.ph-leg-filter:has(.ph-mp-filter-cb:not(:checked)) .ph-leg-dot {
  opacity: 0.35;
}

.ph-leg-wb { color: #a78bfa; }
.ph-leg-ozon { color: #4d9fff; }
.ph-leg-ym { color: #ffd633; }
.ph-leg-rec { color: var(--orange); }

.ph-map-marker-g .ph-map-marker,
.ph-map-marker-g .ph-map-rec-ring,
.ph-map-marker-g .ph-map-label-wh,
.ph-map-marker-g .ph-map-label-mp {
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  transform-box: fill-box;
  transform-origin: center;
}

.ph-map-marker-g .ph-map-marker,
.ph-map-marker-g .ph-map-rec-ring,
.ph-map-marker-g .ph-map-label-wh,
.ph-map-marker-g .ph-map-label-mp,
.ph-map-city circle,
.ph-map-city text,
.fh-city circle,
.fh-city text,
.ph-hub-obukhovo-g circle,
.ph-hub-obukhovo-g text,
.fh-hub-obukhovo-g circle,
.fh-hub-obukhovo-g text {
  vector-effect: non-scaling-stroke;
}

.ph-map-marker-g.ph-mp-hidden .ph-map-marker,
.ph-map-marker-g.ph-mp-hidden .ph-map-rec-ring,
.ph-map-marker-g.ph-mp-hidden .ph-map-label-wh,
.ph-map-marker-g.ph-mp-hidden .ph-map-label-mp {
  opacity: 0;
  transform: scale(0.25);
}

.ph-map-marker-g.ph-mp-hidden,
  pointer-events: none;
}

.ph-rec-panel {
  min-height: 320px;
  max-height: 560px;
  display: flex;
  flex-direction: column;
}

.ph-rec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.ph-rec-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.ph-rec-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.ph-rec-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.ph-rec {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.ph-rec-selected,
.ph-rec:hover {
  border-color: var(--orange) !important;
}

.ph-rec-pic {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 4px;
  background: #f8f8f8;
}

.ph-rec-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.ph-rec-action {
  margin: 0 0 6px;
  font-size: 0.88rem;
  line-height: 1.4;
  font-weight: 600;
}

.ph-rec-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
}

.ph-rec-mp {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f0f0f0;
}

.ph-rec-mp-wb { background: #ede9fe; color: #5b21b6; }
.ph-rec-mp-ozon { background: #dbeafe; color: #1d4ed8; }
.ph-rec-mp-ym { background: #fef9c3; color: #854d0e; }

.ph-rec-wh {
  color: var(--gray);
}

.prognoz-grow-wrap {
  margin-top: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.table-scroll-wrap {
  overflow-x: auto;
  max-width: 100%;
}

@media (max-width: 1100px) {
  .ph-main-layout {
    grid-template-columns: 1fr;
  }

  .ph-rec-panel {
    max-height: none;
  }
}

/* ── Prognoz: таблица «К поставке» по складам ── */
.ph-supply-table-wrap {
  padding: 16px 18px;
}

.ph-st-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ph-st-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
}

.ph-st-sub {
  margin: 0;
}

.ph-st-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ph-st-mp,
.ph-st-wh {
  border: 1px solid var(--border, #e8e8e8);
  border-radius: 8px;
  background: #fafafa;
}

.ph-st-mp > summary,
.ph-st-wh > summary {
  cursor: pointer;
  padding: 10px 14px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.ph-st-mp > summary::-webkit-details-marker,
.ph-st-wh > summary::-webkit-details-marker {
  display: none;
}

.ph-st-mp-sum,
.ph-st-wh-sum {
  width: 100%;
}

.ph-st-wh-group {
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ph-st-table {
  font-size: 0.85rem;
}

.ph-st-product {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

.ph-st-pic {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.ph-st-qty {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.ph-st-od {
  white-space: nowrap;
  text-align: right;
}

.ph-st-act {
  white-space: nowrap;
  text-align: right;
}
