/* Общие улучшения сайта (15.10.2026), к site-plus.js. Откат — тег backup-before-site-improve-20261015 */

/* Меню разделов одной-двумя строками (в светлой теме тоже). :is(#__sp, nav) поднимает специфичность до уровня id. */
@media(min-width:701px){
  html :is(#__sp, nav){display:flex!important;flex-wrap:wrap!important;gap:4px!important;padding:6px 8px!important}
  html :is(#__sp, nav) .nav-group{display:contents!important}
  html :is(#__sp, nav) .nav-group>small{display:none!important}
  html :is(#__sp, nav) button{flex:0 0 auto!important;width:auto!important;min-width:0!important;min-height:30px!important;height:auto!important;padding:5px 11px!important;font-size:12.5px!important;line-height:1.2!important;border-radius:9px!important}
}

/* Цветные карточки показателей во всех разделах, как в «Оформленных продажах» */
.theme-light :is(#deliveredCards,#soiCards,#regionsCards,#doCards,#cancelCards)>.card{border:1px solid #4e4d4d!important;border-radius:22px!important}
.theme-light :is(#deliveredCards,#soiCards,#regionsCards,#doCards,#cancelCards)>.card:nth-child(5n+1){background:radial-gradient(circle at 0% 0%,#cbd7f6 0%,#dce4fa 36%,#f6f3f1 78%)!important}
.theme-light :is(#deliveredCards,#soiCards,#regionsCards,#doCards,#cancelCards)>.card:nth-child(5n+2){background:radial-gradient(circle at 0% 0%,#f2dda1 0%,#f7e8bd 34%,#f6f3f1 78%)!important}
.theme-light :is(#deliveredCards,#soiCards,#regionsCards,#doCards,#cancelCards)>.card:nth-child(5n+3){background:radial-gradient(circle at 0% 0%,#e4cfe0 0%,#eadfea 36%,#f6f3f1 78%)!important}
.theme-light :is(#deliveredCards,#soiCards,#regionsCards,#doCards,#cancelCards)>.card:nth-child(5n+4){background:radial-gradient(circle at 0% 0%,#f4cf9d 0%,#f7dfbd 36%,#f6f3f1 78%)!important}
.theme-light :is(#deliveredCards,#soiCards,#regionsCards,#doCards,#cancelCards)>.card:nth-child(5n){background:radial-gradient(circle at 0% 0%,#c8d8f4 0%,#dbe5f8 36%,#f6f3f1 78%)!important}

/* Длинные таблицы «Комиссий» и «Регионов»: прокрутка внутри блока, шапка таблицы закреплена */
#commissions .table-wrap,#regions section.panel:last-of-type .table-wrap{max-height:72vh;overflow:auto!important}
#commissions .table-wrap thead th,#regions section.panel:last-of-type .table-wrap thead th{position:sticky;top:0;z-index:2;background:var(--panel,#f2f2f3)}

/* «Рекомендации»: группы по товару */
.sp-rec-bar{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center;margin:4px 0 10px}
.sp-rec-bar input{min-width:260px;min-height:32px}
details.sp-rec{border:1px solid var(--line,#dfe1e5);border-radius:12px;margin:0 0 8px;background:var(--panel-hi,transparent)}
details.sp-rec>summary{cursor:pointer;padding:10px 12px;display:flex;gap:10px;align-items:baseline;list-style:none}
details.sp-rec>summary::-webkit-details-marker{display:none}
details.sp-rec>summary::before{content:'▸';color:var(--muted)}details.sp-rec[open]>summary::before{content:'▾'}
details.sp-rec>summary span{flex:1;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
details.sp-rec>summary i{font-style:normal;font-weight:700;padding:0 8px;border-radius:10px;background:var(--line-soft,#ececef)}
details.sp-rec>.card{margin:0 10px 8px!important}

/* «Пользователи»: вкладки */
.sp-tabs{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0 14px;border-bottom:1px solid var(--line,#dfe1e5)}
.sp-tabs button{border:1px solid transparent;border-bottom:0;border-radius:8px 8px 0 0;background:none;color:var(--muted);padding:7px 14px;cursor:pointer;font-size:13px}
.sp-tabs button[aria-selected="true"]{background:var(--bg,#fff);color:var(--text);border-color:var(--line,#dfe1e5);font-weight:700}
#admin .sp-off{display:none!important}

/* «Анализ причин» и пояснение «Отмен» */
.sp-explain{margin:4px 0 16px}
.sp-seg{display:inline-flex;gap:4px;margin-bottom:8px}.sp-seg button{padding:5px 12px;border-radius:14px;border:1px solid var(--line,#dfe1e5);background:none;color:inherit;cursor:pointer}
.sp-seg button.on{background:#5d2a1a;color:#fff;border-color:#5d2a1a}
.sp-explain ol{margin:0;padding-left:18px;font-size:13px}.sp-explain li{margin:3px 0}
.sp-note-box{margin:8px 0 12px;padding:8px 12px;border-left:4px solid var(--warn,#d8a33a);border-radius:8px;background:color-mix(in srgb,var(--warn,#d8a33a) 8%,transparent);font-size:13px}
.sp-explain .sp-t,.sp-explain .sp-grid2{max-width:820px}

/* «Заказы» (сборка) на телефоне: компактная карточка. Столбцы (без ячейки выбора): 1 площадка, 2 товар, 3 кластер,
   4 к сборке, 5 заказов, 6 дата заказа, 7 срок отгрузки, 8 собрано, 9 этикетки. Прежние мобильные подписи были сдвинуты
   (кластер подписывался как «К сборке») — здесь подписи по настоящим заголовкам. */
@media(max-width:700px){
  #warehouse #whTableWrap .wh-sku-table tr{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:4px 10px!important;padding:10px 12px!important}
  #warehouse #whTableWrap .wh-sku-table td{padding:0!important;font-size:13px!important;border:0!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;gap:1px!important}
  #warehouse #whTableWrap .wh-sku-table td::before{font-size:10px!important;color:var(--muted)!important;text-transform:uppercase!important;letter-spacing:.04em!important}
  #warehouse #whTableWrap .wh-sku-table td.wh-selection-cell{grid-row:1!important;grid-column:1/2!important;font-size:12px!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(1 of :not(.wh-selection-cell)){grid-row:1!important;grid-column:2/-1!important;flex-direction:row!important;justify-content:flex-end!important;align-items:center!important;font-size:12px!important;color:var(--muted)!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(1 of :not(.wh-selection-cell))::before{content:none!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(2 of :not(.wh-selection-cell)){grid-row:2!important;grid-column:1/3!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(2 of :not(.wh-selection-cell))::before{content:none!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(2 of :not(.wh-selection-cell)) small{font-size:15px!important;line-height:1.25!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(4 of :not(.wh-selection-cell)){grid-row:2!important;grid-column:3/4!important;align-items:flex-end!important;font-size:30px!important;font-weight:800!important;line-height:1!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(4 of :not(.wh-selection-cell))::before{content:'к сборке'!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(3 of :not(.wh-selection-cell)){grid-row:3!important;grid-column:1/-1!important;font-size:12px!important;color:var(--muted)!important;font-weight:600!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(3 of :not(.wh-selection-cell))::before{content:'кластер'!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(n+5 of :not(.wh-selection-cell)){grid-row:4!important;border-top:1px dashed var(--line-soft,#ececef)!important;padding-top:5px!important;font-size:12.5px!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(5 of :not(.wh-selection-cell)){grid-column:1!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(5 of :not(.wh-selection-cell))::before{content:'заказов'!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(6 of :not(.wh-selection-cell)){grid-column:2!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(6 of :not(.wh-selection-cell))::before{content:'дата заказа'!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(7 of :not(.wh-selection-cell)){grid-column:3!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(7 of :not(.wh-selection-cell))::before{content:'срок отгрузки'!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(8 of :not(.wh-selection-cell)){grid-row:5!important;grid-column:1!important;border:0!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(8 of :not(.wh-selection-cell))::before{content:'собрано'!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(9 of :not(.wh-selection-cell)){grid-row:5!important;grid-column:2/-1!important;border:0!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(9 of :not(.wh-selection-cell))::before{content:'этикетки'!important}
}@media(max-width:700px){
  #warehouse #whTableWrap .wh-sku-table td.wh-selection-cell{flex-direction:row!important;align-items:center!important;gap:6px!important;white-space:nowrap!important;min-height:0!important}
  #warehouse #whTableWrap .wh-sku-table td.wh-selection-cell *{margin:0!important}
  #warehouse #whTableWrap .wh-sku-table td.wh-selection-cell input{width:18px!important;height:18px!important}
  #warehouse #whTableWrap .wh-sku-table tr>*{min-height:0!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(8 of :not(.wh-selection-cell)) input{width:22px!important;height:22px!important;margin:2px 0 0!important}
  #warehouse #whTableWrap .wh-sku-table td:nth-child(n+10 of :not(.wh-selection-cell)){display:none!important}
}