/* ---------- Склейки: /glue ----------
   Собраны из готового: шапка, поиск и плашка — классы юнитки (.unit-*), плитки и
   таблица — отчёта (.report-kpis, .report-table), окно — stockModal. Своё здесь —
   четыре плитки вместо пяти, отступ под переключателем магазина и кнопки. */
section[data-pane="glue"] .shopslot { margin-bottom: 14px; }
#glue-root > .panelhead { margin-bottom: 14px; flex-wrap: wrap; }
.kpigrid.report-kpis.glue-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#glue-root .ghost { display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--text-2);
  padding: 8px 16px; font-size: 13px; font-weight: 600; }
#glue-root .ghost:hover:not(:disabled) { border-color: var(--text); color: var(--text); }
#glue-root .ghost:disabled { opacity: .6; cursor: default; }
.glue-table tbody tr[data-glue] { cursor: pointer; }
.glue-table tbody tr[data-glue]:hover td { background: var(--card-hover); }
.glue-table .unit-badges { margin-top: 4px; }
.glue-table td.num .sku { display: block; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }

/* Средняя ширина: у отчёта тут 3 + 2 (span 2 и span 3 из 15-report.css), четырём
   плиткам это даёт три кривых ряда — делаем полосу 2 + 2 тем же разделителем. */
@media (min-width: 641px) and (max-width: 1100px) {
  .kpigrid.report-kpis.glue-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-kpis.glue-kpis .kpi, .report-kpis.glue-kpis .kpi:nth-child(n+4) { grid-column: auto; }
  .report-kpis.glue-kpis .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .report-kpis.glue-kpis .kpi:nth-child(3) { border-left: 0; padding-left: 0; }
  .report-kpis.glue-kpis .kpi:nth-child(4) { border-left: 1px solid var(--line); padding-left: 22px; }
}

@media (max-width: 640px) {
  #glue-root > .panelhead h2 { flex: 1 1 100%; line-height: 1.3; }
  #glue-root > .panelhead .unit-fresh { display: block; margin: 4px 0 0; font-size: 13px; }
  #glue-root .ghost { flex: 1 1 100%; min-height: 44px; }
  #glue-root .unit-filters .seg { flex: 1 1 100%; }
  #glue-root .unit-filters .seg button { min-height: 40px; }
  .unit-search#glue-search { max-width: none; }
  /* Четыре плитки — полосой 2 + 2: последняя не растягивается на всю ширину. */
  .kpigrid.report-kpis.glue-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-kpis.glue-kpis .kpi:last-child { grid-column: auto; }
  .report-kpis.glue-kpis .kpi:nth-last-child(-n+2) { border-bottom: 0; }
}
