/* PIM «СтройСистема» — спокойный светлый интерфейс */

:root {
  /* Фирменные цвета stroyst.ru: синий #005195 (логотип), голубой, серый, чёрный */
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --ink: #16181B;
  --ink-2: #4E565E;
  --ink-3: #939CA5;
  --line: #E2E6EB;
  --line-strong: #CDD4DB;
  --accent: #005195;
  --accent-ink: #003C6E;
  --accent-soft: #E4EEF7;
  --indigo: #1B74C5;
  --ok: #2E7D32;
  --warn: #B26A00;
  --bad: #C03A2E;
  --danger-soft: #FBEAE8;
  --shadow-sm: 0 1px 2px rgba(22, 24, 27, .06);
  --shadow-md: 0 4px 16px rgba(22, 24, 27, .1);
  --r: 0;
  --r-sm: 0;
  --sans: "Golos Text", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* строгая геометрия: без скруглений вообще */
*, *::before, *::after { border-radius: 0 !important; }

[hidden] { display: none !important; }

html { scrollbar-gutter: stable; }

body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Каркас: сайдбар + контент ---------- */

.layout { display: flex; min-height: 100vh; }

.side {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex; flex-direction: column; gap: 7px;
  padding: 6px 10px 18px;
}
.brand .logo-img { width: 100%; max-width: 192px; height: auto; display: block; }
.brand small { font-size: 11px; color: var(--ink-3); padding-left: 2px; }

.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 13.5px;
  text-decoration: none;
}
.side nav a svg { width: 17px; height: 17px; flex-shrink: 0; }
.side nav a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.side nav a.active { background: var(--accent-soft); color: var(--accent-ink); }

.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }

.content { flex: 1; min-width: 0; padding: 28px 32px 80px; max-width: 1440px; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .side {
    width: 100%; height: auto; position: static;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 8px; padding: 10px 12px 8px;
  }
  /* строка 1: логотип слева, пользователь и «Выйти» справа */
  .side .brand { display: flex; align-items: center; gap: 8px; }
  .side .brand .logo-img { width: 128px; max-width: 128px; }
  .side .brand small { display: none; }
  .side .foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 6px; }
  .side .foot .userbox { padding: 4px 8px; }
  .side .foot .userbox .u small { display: none; }
  /* «Импорт XLSX» и «API-документация» — компактно в той же строке */
  .side .foot > .btn { padding: 5px 9px; font-size: 11.5px; }
  /* строка 2: навигация лентой на всю ширину, прокручивается вбок */
  .side nav {
    order: 3; width: 100%; flex-direction: row; gap: 2px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--line);
    padding-top: 7px; padding-bottom: 10px; margin-top: 2px;
  }
  .side nav::-webkit-scrollbar { height: 4px; }
  .side nav::-webkit-scrollbar-thumb { background: var(--line-strong); }
  .side nav a { flex-shrink: 0; padding: 7px 11px; font-size: 12.5px; gap: 7px; }
  .side nav a svg { width: 15px; height: 15px; }
  .content { padding: 20px 16px 60px; }
}
@media (max-width: 560px) {
  /* совсем узкий экран: имя пользователя и ссылку на API прячем, остаётся главное */
  .side .brand .logo-img { width: 108px; max-width: 108px; }
  .side .foot .userbox .u { display: none; }
  .side .foot .userbox { border: none; background: none; padding: 0; }
  .side .foot a[href="/docs"] { display: none; }
}

/* ---------- Общие ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
h1.title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.subtitle { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.subtitle b { color: var(--accent-ink); font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.btn {
  font-family: var(--sans);
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .12s, border-color .12s, color .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--bg); border-color: var(--ink-3); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn:disabled { opacity: .45; cursor: default; }

input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  outline: none;
  width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 81, 149, .14);
}
textarea { resize: vertical; min-height: 70px; }
::placeholder { color: var(--ink-3); }

/* Селекты: своя стрелка вплотную к тексту (нативная уезжает к краю) */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234E565E' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-2); }
.small { font-size: 12.5px; }

/* ---------- Дашборд ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
/* мобильный дашборд: плитки по две в строке */
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile { padding: 13px 14px; }
  .tile .num { font-size: 22px; }
}
.tile { padding: 16px 18px; }
.tile .num { font-size: 27px; font-weight: 700; letter-spacing: -.5px; }
.tile .lbl { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }

.panel { padding: 18px 20px 20px; }
.panel h3 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.panel-head h3 { margin-bottom: 14px; }
.panel-head a { font-size: 12px; font-weight: 500; color: var(--accent-ink); white-space: nowrap; }

.hbar-row { display: grid; grid-template-columns: 185px 1fr 52px; gap: 10px; align-items: center; padding: 4.5px 6px; border-radius: 6px; }
.hbar-row:hover { background: var(--bg); }
.hbar-label { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; }
.hbar-fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-fill.alt { background: var(--indigo); }
.hbar-val { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--ink-2); }

/* Правила начисления процентов полноты */
.score-rules {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; margin-bottom: 12px;
  display: flex; flex-direction: column; gap: 5px;
}
.score-rules .sr-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 3px; }
.score-rules .sr { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; color: var(--ink-2); }
.score-rules .sr .pct {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--accent-ink);
  min-width: 48px; text-align: right; flex-shrink: 0;
}
/* самостоятельный информационный блок правил — голубая плашка на всю ширину */
.score-rules.standalone {
  margin-top: 16px; padding: 16px 20px 18px;
  background: var(--accent-soft); border: 1px solid #BFD7EC;
  display: block;
}
.score-rules.standalone .sr-head {
  display: flex; gap: 11px; align-items: flex-start; margin-bottom: 12px;
}
.score-rules.standalone .sr-head svg { flex-shrink: 0; margin-top: 1px; }
.score-rules.standalone .sr-head b { font-size: 14px; color: var(--accent-ink); }
.score-rules.standalone .sr-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.score-rules.standalone .sr-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 28px;
}
.score-rules.standalone .sr { color: var(--ink); }
.score-rules.standalone .sr:last-child { grid-column: 1 / -1; }
.score-rules.standalone .sr .pct {
  background: #fff; border-radius: 999px; padding: 2px 9px; min-width: 56px;
  text-align: center; box-shadow: var(--shadow-sm);
}

.worst-list { list-style: none; }
.worst-list li {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 7px 6px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.worst-list li:hover { background: var(--bg); }
.worst-list .pc { font-family: var(--mono); font-size: 11.5px; font-weight: 500; }

/* ---------- Каталог ---------- */

.catalog { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; }
.sidebar-cats { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; padding: 12px 8px; }
.sidebar-cats h3 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); padding: 4px 10px 8px; }
.cats-arrow { display: none; }
/* кнопка «Фильтры» существует только в мобильной вёрстке */
#m-filters { display: none; }
.m-arrow { font-size: 12px; }
/* мобильный каталог: одна колонка, «Категории» — сворачиваемый блок со стрелкой */
@media (max-width: 980px) {
  .catalog { grid-template-columns: 1fr; }
  .sidebar-cats { position: static; max-height: none; overflow: visible; }
  .sidebar-cats h3 {
    cursor: pointer; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px;
  }
  .sidebar-cats h3 .cats-arrow { display: inline-block; font-size: 13px; transition: transform .15s; }
  .sidebar-cats.open h3 .cats-arrow { transform: rotate(180deg); }
  .sidebar-cats:not(.open) > :not(h3) { display: none; }
  .sidebar-cats:not(.open) { padding-bottom: 8px; }
  /* фильтры спрятаны под кнопкой «Фильтры ▾» */
  #m-filters { display: inline-flex; margin-bottom: 12px; }
  #m-filters .m-arrow { display: inline-block; transition: transform .15s; }
  #m-filters.on .m-arrow { transform: rotate(180deg); }
  .facets:not(.open) { display: none; }
}
.cat-tree { list-style: none; }
.cat-row {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 13px;
  user-select: none;
}
.cat-row:hover { background: var(--bg); }
.cat-row.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.cat-toggle { width: 15px; font-size: 9px; color: var(--ink-3); flex-shrink: 0; text-align: center; margin-top: 4px; }
/* название раздела показываем целиком — переносим на следующую строку */
.cat-name { flex: 1; line-height: 1.35; overflow-wrap: break-word; min-width: 0; }
.cat-count { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); flex-shrink: 0; margin-top: 2px; }
/* «Все товары» — заметная кнопка-строка над деревом; не путать с активным разделом
   (у активного — синяя заливка без рамки, здесь — рамка) */
.cat-row.cat-all {
  font-weight: 600; border: 1px solid var(--line-strong);
  padding-top: 8px; padding-bottom: 8px; margin-bottom: 9px;
  align-items: center;
}
.cat-row.cat-all .cat-toggle { color: var(--accent); margin-top: 0; display: flex; justify-content: center; }
.cat-row.cat-all:hover { background: var(--bg); }
.cat-row.cat-all.active { background: var(--accent-soft); border-color: var(--accent); }
.cat-tree .cat-tree .cat-row { padding-left: 26px; }
.cat-tree .cat-tree .cat-tree .cat-row { padding-left: 42px; }

.toolbar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar .search { flex: 1; min-width: 220px; }
/* лупа перед плейсхолдером поиска */
.toolbar .search input {
  padding-left: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='4.6' fill='none' stroke='%23939CA5' stroke-width='1.6'/%3E%3Cpath d='M10.6 10.6L14 14' stroke='%23939CA5' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.toolbar select { width: auto; }

/* Мультивыбор значений свойства */
/* мобильный: квадрат-лупа + селекты в одну строку; окно ввода раскрывается на всю ширину */
#m-search { display: none; }
@media (max-width: 980px) {
  .toolbar { flex-wrap: wrap; gap: 6px; }
  #m-search {
    display: inline-flex; align-items: center; justify-content: center;
    width: 37px; height: 37px; flex-shrink: 0;
    background: var(--surface); border: 1px solid var(--line-strong);
    color: var(--ink-2); cursor: pointer; padding: 0;
  }
  .toolbar.qopen #m-search { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
  .toolbar .search { display: none; }
  .toolbar.qopen .search { display: block; flex: 1 1 100%; order: 10; min-width: 0; }
  .toolbar .search input { width: 100%; padding-left: 30px; background-position: 9px center; }
  .toolbar select {
    min-width: 0; max-width: 40vw; flex: 1 1 auto;
    font-size: 12px; padding: 8px 5px;
    text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  }
}

.facets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.msel { position: relative; }
.msel > button {
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 6px 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.msel > button:hover { border-color: var(--ink-3); color: var(--ink); }
.msel.has > button { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.msel .n { font-family: var(--mono); font-size: 10.5px; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 6px; line-height: 16px; }
.msel .pop {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  min-width: 230px; max-width: 320px; max-height: 340px;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-md); padding: 6px;
}
.msel .pop[hidden] { display: none; }
/* широкие фильтры — длинные значения в одну строку */
#ms-brand .pop { min-width: 340px; max-width: 400px; }
#ms-brand .opt span:not(.c) { white-space: nowrap; }
#ms-vid-germetika .pop, #ms-tsvet .pop, #ms-t-primeneniya .pop, #ms-t-ispolzovaniya .pop {
  min-width: 360px; max-width: 430px;
}
#ms-vid-germetika .opt span:not(.c), #ms-tsvet .opt span:not(.c),
#ms-t-primeneniya .opt span:not(.c), #ms-t-ispolzovaniya .opt span:not(.c) {
  white-space: nowrap;
}
.msel .msel-q { margin-bottom: 6px; padding: 6px 10px; font-size: 12.5px; flex-shrink: 0; }
.msel .msel-opts { overflow: auto; }
.msel .opt.none { cursor: default; color: var(--ink-3); font-size: 12px; }
.msel .opt {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 9px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.msel .opt:hover { background: var(--bg); }
.msel .opt input { width: auto; accent-color: var(--accent); }
.msel .opt .c { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chips:empty { display: none; }
.chip {
  font-size: 12px; font-weight: 500;
  background: var(--accent-soft); color: var(--accent-ink);
  border: none; border-radius: 999px; padding: 5px 12px; cursor: pointer;
  display: inline-flex; gap: 6px; align-items: center;
}
.chip:hover { background: var(--danger-soft); color: var(--bad); }
.chip small { opacity: .65; font-size: 10.5px; }

/* Сетка товаров */
/* карточки слеплены: у соседей общий 1px-бордер (рамка сетки сверху/слева, у карточек — справа/снизу) */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.grid:has(.empty) { border: none; }
/* мобильный: товары по два в строке */
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

.pcard {
  cursor: pointer; display: flex; flex-direction: column; overflow: hidden;
  position: relative;
  border-width: 0 1px 1px 0; box-shadow: none;
}
/* лёгкая подсветка рамки наведённой карточки: слой-кольцо ПОВЕРХ содержимого
   (фото не перекрывает), клики пропускает, соседей и сетку не трогает */
.grid .pcard::after {
  content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .12s;
}
.grid .pcard:hover::after { box-shadow: inset 0 0 0 1px #8FB2D4; }
.pcard .ph {
  aspect-ratio: 1; background: #fff;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.pcard .ph img:not(.bmark) { width: 100%; height: 100%; object-fit: contain; }
.pcard .ph .noimg { font-size: 11px; color: var(--ink-3); }
.pcard .body { padding: 11px 13px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
/* метка бренда (логотип или название) — верхний правый угол фото */
.pcard .bmark { position: absolute; top: 9px; right: 9px; z-index: 5; max-width: 62%; }
.pcard .brand {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px;
  color: var(--accent-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-block; background: rgba(255,255,255,.92);
  border: 1px solid var(--line); padding: 2px 8px;
}
/* если у карточки есть «✕» (исключить из списка) или статус-бейдж — бренд ниже них */
.pcard:has(.rm-btn) .bmark, .pcard:has(.st-badge) .bmark { top: 42px; }
.pcard .tchip {
  font-size: 9.5px; font-weight: 500; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
  white-space: nowrap; flex-shrink: 0;
}
.pcard .nm { font-size: 12.5px; line-height: 1.4; font-weight: 500; flex: 1; }
.pcard .idrow { display: flex; justify-content: space-between; gap: 8px; }
.pcard .sku { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pid { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); flex-shrink: 0; }
.pcard .cardfoot { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.pcard .cnts { font-size: 11px; color: var(--ink-3); }

.st-badge {
  position: absolute; top: 9px; right: 9px; z-index: 4;
  font-size: 10px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--warn); color: #fff;
}
.st-badge.archived { background: var(--ink-3); }

.pick {
  position: absolute; top: 9px; left: 9px; z-index: 5;
  width: 21px; height: 21px; accent-color: var(--accent); cursor: pointer;
  opacity: 0; transition: opacity .12s;
  border-radius: 6px;
}
.pcard:hover .pick, .pick:checked { opacity: 1; }

.meter { display: flex; align-items: center; gap: 8px; }
.meter .track { flex: 1; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter .fill { height: 100%; border-radius: 99px; }
.meter .pc { font-family: var(--mono); font-size: 10px; color: var(--ink-2); min-width: 30px; text-align: right; }

/* Панель выбранных товаров — всплывает снизу по центру */
.selbar {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 10px 12px 10px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-md); z-index: 60;
  font-size: 13px; white-space: nowrap;
}
.selbar .btn { border: none; }
#sel-dl { display: inline-flex; gap: 9px; }
/* Протяжка-выбор карточек: не выделяем текст и не таскаем картинки */
body.dragsel { user-select: none; -webkit-user-select: none; }
body.dragsel .grid .pcard { cursor: cell; }
/* во время протяжки плавающие панели не должны перехватывать точку под пальцем */
body.dragsel .selbar, body.dragsel #sel-dl, body.dragsel #cat-actions.stuck { pointer-events: none; }
/* Выбранная карточка — голубое наложение на всю карточку, как в галерее */
.grid .pcard:has(.pick:checked)::before {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: #E4EEF7; mix-blend-mode: multiply;
}
.grid .pcard:has(.pick:checked)::after { box-shadow: inset 0 0 0 1px #8FB2D4; }
/* Панель действий каталога при прокрутке едет сверху компактной полоской */
#cat-actions.stuck {
  position: fixed; top: 0; z-index: 55;
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 7px 12px; margin: 0;
  justify-content: flex-end;
  box-shadow: 0 2px 8px rgba(20, 40, 60, .07);
}
#cat-actions.stuck .btn { padding: 5px 10px; font-size: 12px; }
#cat-actions.stuck .fmt-btn { padding: 4px 9px; }
/* «исключено: −N» — кликабельный тег на детальной странице списка */
.tag-btn { cursor: pointer; }
.tag-btn:hover { background: var(--accent-soft); }
.excl-list { display: flex; flex-direction: column; max-height: 55vh; overflow-y: auto; }
.excl-row {
  display: flex; gap: 10px; align-items: center;
  padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.excl-row .rt { width: 36px; height: 36px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex-shrink: 0; }
.excl-row .rt.none { display: inline-block; }
.excl-row .rn { flex: 1; color: var(--ink); }
.excl-row .rn:hover { color: var(--accent-ink); }
.excl-row .sku { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); flex-shrink: 0; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 24px; }
.pager .info { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); padding: 0 8px; }

.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- Списки экспорта ---------- */

.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.lcard { padding: 18px 20px 14px; display: flex; flex-direction: column; gap: 9px; }
.lcard .lc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.lcard .nm { font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1.35; }
.lcard .nm:hover { color: var(--accent-ink); }
.lcard .lc-count {
  font-size: 11.5px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: 3px 11px;
  white-space: nowrap; flex-shrink: 0;
}
.lcard .meta { font-size: 12px; color: var(--ink-3); }
.lcard .lc-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto;
}
.lcard .lc-fmts, .lcard .lc-ops { display: flex; gap: 6px; }

/* кнопка формата выгрузки с иконкой файла */
.fmt-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .3px; color: var(--ink-2);
  background: var(--surface); text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.fmt-btn:hover { background: var(--bg); border-color: var(--ink-3); color: var(--ink); text-decoration: none; }
.fmt-btn svg { flex-shrink: 0; display: block; }

/* «Выгрузить этот товар»: обычная кнопка + выпадающие форматы */
.expone > button.btn {
  border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  padding: 8px 14px; letter-spacing: 0; text-transform: none;
}
.expone > button.btn:hover { background: var(--bg); border-color: var(--ink-3); }
.expone .pop { min-width: 150px; }
.expone .pop a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-decoration: none;
}
.expone .pop a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }

.filter-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-summary .tag {
  font-size: 11.5px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; color: var(--ink-2);
}
.filter-summary .tag b { color: var(--ink); font-weight: 600; }

.cols-box { display: flex; flex-wrap: wrap; gap: 6px; }
.colchk {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; cursor: pointer; user-select: none;
}
.colchk input { width: auto; accent-color: var(--accent); }
.colchk.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.list-head-card { padding: 20px 22px; margin-bottom: 18px; }
.cols-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.cols-summary { font-size: 12.5px; color: var(--ink-2); }
.cols-head-actions { margin-left: auto; display: flex; gap: 8px; }
#l-cols-panel {
  border: 1px solid var(--line); background: var(--bg);
  padding: 14px 16px 16px; margin-top: 10px;
}
.section-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); margin: 16px 0 8px; }
.section-label:first-child { margin-top: 0; }

.rm-btn {
  position: absolute; top: 9px; right: 9px; z-index: 5;
  width: 24px; height: 24px; border-radius: 7px; border: none;
  background: rgba(255,255,255,.92); color: var(--bad);
  cursor: pointer; font-size: 13px; line-height: 1;
  opacity: 0; transition: opacity .12s;
  box-shadow: var(--shadow-sm);
}
.pcard:hover .rm-btn { opacity: 1; }
.rm-btn:hover { background: var(--danger-soft); }

/* ---------- Карточка товара ---------- */

.crumbs { font-size: 12.5px; color: var(--ink-2); margin-bottom: 16px; }
.crumbs a { color: var(--ink-2); }

.product { display: grid; grid-template-columns: 390px 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .product { grid-template-columns: 1fr; } }

.gallery { overflow: hidden; }
.gallery .main-ph { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery .main-ph img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs .th {
  width: 60px; height: 60px; background: #fff; border: 1px solid var(--line);
  border-radius: 9px; cursor: pointer; overflow: hidden; padding: 4px;
  display: flex; align-items: center; justify-content: center;
}
.thumbs .th img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumbs .th.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,81,149,.2); }

.pinfo { padding: 22px 24px; }
.pinfo .ptype { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-ink); margin-bottom: 6px; }
.pinfo h1 { font-size: 19px; line-height: 1.35; margin-bottom: 10px; font-weight: 700; letter-spacing: -.2px; }
.pinfo .idline { font-size: 12.5px; color: var(--ink-2); margin-bottom: 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.pinfo .idline b { color: var(--ink); font-weight: 600; font-family: var(--mono); font-size: 12px; }

.attr-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.attr-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
.attr-table td:first-child { color: var(--ink-2); width: 46%; }
.attr-table tr:last-child td { border-bottom: none; }
.attr-table tr:hover td { background: var(--bg); }

.section-h { font-size: 13.5px; font-weight: 700; margin: 20px 0 8px; }
.section-h span { color: var(--ink-3); font-weight: 500; }

/* Детальное описание: HTML с сайта, очищенный от инлайн-стилей, — своя типографика */
.desc-html { font-size: 13.5px; line-height: 1.65; overflow-wrap: anywhere; color: var(--ink); }
.desc-html img { max-width: 100%; height: auto; border-radius: 8px; }
.desc-html p { margin: 0 0 10px; }
.desc-html ul, .desc-html ol { margin: 0 0 10px; padding-left: 22px; }
.desc-html li { margin-bottom: 4px; }
.desc-html h1, .desc-html h2, .desc-html h3, .desc-html h4 {
  font-size: 14px; font-weight: 700; margin: 14px 0 8px; line-height: 1.4;
}
.desc-html strong, .desc-html b { font-weight: 600; }
.desc-html table { border-collapse: collapse; margin: 10px 0; width: 100%; }
.desc-html td, .desc-html th { border: 1px solid var(--line); padding: 6px 10px; font-size: 13px; }
.desc-html a { color: var(--accent-ink); }

/* Лайтбокс фото */
#lightbox {
  max-width: none; width: 100vw; height: 100vh; max-height: none;
  background: transparent; border: none; box-shadow: none; padding: 0; margin: 0;
  display: none; align-items: center; justify-content: center;
}
#lightbox[open] { display: flex; }
#lightbox::backdrop { background: rgba(10, 14, 18, .82); }
#lb-img {
  max-width: 88vw; max-height: 88vh; object-fit: contain;
  background: #fff; border-radius: 12px; box-shadow: 0 10px 50px rgba(0,0,0,.5);
}
#lightbox button {
  position: fixed; z-index: 5; border: none; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff;
  width: 46px; height: 46px; border-radius: 50%; font-size: 22px; line-height: 1;
  transition: background .12s;
}
#lightbox button:hover { background: rgba(255,255,255,.28); }
#lb-close { top: 20px; right: 24px; font-size: 17px; }
#lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
#lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
#lb-counter {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; background: rgba(0,0,0,.45);
  padding: 4px 14px; border-radius: 999px;
}
.gallery .main-ph { cursor: zoom-in; }

/* Логотипы брендов */
.brand-logo {
  height: 22px; max-width: 90px; object-fit: contain; display: inline-block;
  background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 2px 5px;
}
.brand-logo.lg { height: 30px; max-width: 110px; padding: 3px 7px; border-radius: 7px; }
.brand-logo.none { width: 44px; background: var(--bg); }

/* логотип в опции выпадающего фильтра */
.msel .opt-ico {
  width: 50px; height: 20px; object-fit: contain; flex-shrink: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1px 3px;
}
/* логотип на карточке в сетке (вместо бейджа типа) */
.pcard .tlogo {
  height: 20px; max-width: 68px; object-fit: contain; flex-shrink: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
/* крупный логотип в шапке карточки товара */
.pinfo .h1row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.pinfo .h1row h1 { flex: 1; }
.pinfo .h1row .blogo {
  height: 36px; max-width: 132px; object-fit: contain; flex-shrink: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px;
}

/* Связанные торговые предложения */
.rel-list {
  border: 1px solid var(--line); border-radius: 10px;
  max-height: 280px; overflow: auto; margin-top: 4px;
}
.rel {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; font-size: 12.5px; color: var(--ink);
  border-bottom: 1px solid var(--line); text-decoration: none;
}
.rel:last-child { border-bottom: none; }
a.rel:hover { background: var(--accent-soft); text-decoration: none; }
.rel .rt {
  width: 36px; height: 36px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 7px;
  background: #fff; object-fit: contain; display: block;
}
.rel .rt.none { background: var(--bg); }
.rel .rn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel .sku { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); flex-shrink: 0; }
.rel .pc { font-family: var(--mono); font-size: 10.5px; flex-shrink: 0; }
.rel.cur { background: var(--bg); }
.rel.cur .rn { font-weight: 600; }
.tag-cur {
  font-size: 9.5px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; flex-shrink: 0;
}

/* Списки выгрузки на карточке товара */
.plists { display: flex; flex-wrap: wrap; gap: 7px; }
.plist-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: 5px 13px;
  text-decoration: none;
}
.plist-tag:hover { background: var(--accent); color: #fff; text-decoration: none; }
.plist-tag span { font-family: var(--mono); font-size: 10.5px; opacity: .7; }

/* Раскладка полноты в модалке */
.sc-list { display: flex; flex-direction: column; margin-top: 4px; }
.sc-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 2px; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.sc-row:last-child { border-bottom: none; }
.sc-row .sc-ic { width: 18px; text-align: center; font-weight: 700; flex-shrink: 0; }
.sc-row.ok .sc-ic { color: var(--ok); }
.sc-row.part .sc-ic { color: var(--warn); }
.sc-row.miss .sc-ic { color: var(--bad); }
.sc-row.miss .sc-nm { color: var(--ink-3); }
.sc-row .sc-nm { flex: 1; }
.sc-row .sc-pts { font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.sc-row.total { border-top: 1px solid var(--line-strong); margin-top: 4px; }
.sc-note { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }

/* Фото 360 */
.p360 {
  position: relative; aspect-ratio: 1; overflow: hidden;
  cursor: grab; user-select: none; touch-action: pan-y; background: #fff;
}
.p360.grabbing { cursor: grabbing; }
.p360 img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.p360-hint {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; color: var(--ink-2); background: rgba(255,255,255,.85);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; white-space: nowrap;
}

/* Файлы и медиа (DAM) */
.am-list { display: flex; flex-direction: column; gap: 6px; }
.am-row { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; }
.am-row .am-k { color: var(--ink-2); flex-shrink: 0; min-width: 150px; }
.am-row .am-links { display: flex; flex-wrap: wrap; gap: 6px; }
.am-row .am-links a {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 10px; font-size: 11.5px; overflow-wrap: anywhere;
}

/* Живой прогресс полноты в редакторе */
.edit-progress {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 0 14px; padding: 10px 14px;
  background: var(--accent-soft); border: 1px solid #BFD7EC;
}
.edit-progress .ep-lbl { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.edit-progress .meter { flex: 1; }

/* Бейдж вклада поля в полноту */
.pct-b {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--accent-ink); background: var(--accent-soft); border: 1px solid #BFD7EC;
  padding: 1px 6px; margin-left: 4px; vertical-align: 1px;
}

/* Превью медиа: перетаскивание меняет порядок */
.mprev { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 6px; }
.mprev:empty { display: none; }
.mp-item {
  position: relative; width: 62px; height: 62px;
  border: 1px solid var(--line-strong); background: #fff;
  cursor: grab; display: flex; align-items: center; justify-content: center;
}
.mp-item:active { cursor: grabbing; }
.mp-item.dr { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mp-item img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; }
.mp-file {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ink-2);
  background: var(--bg); width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.mp-del {
  position: absolute; top: -1px; right: -1px; width: 17px; height: 17px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--bad);
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.mp-del:hover { background: var(--danger-soft); }
.mp-main {
  position: absolute; bottom: -1px; left: -1px; right: -1px;
  font-size: 8.5px; font-weight: 700; text-align: center; letter-spacing: .5px;
  background: var(--accent); color: #fff; padding: 1px 0; text-transform: uppercase;
}

/* Drag-and-drop зоны в редакторе медиа */
.dz { display: flex; flex-direction: column; }
.dz textarea { border-radius: var(--r-sm) var(--r-sm) 0 0; margin-bottom: 0; }
.dz-bar {
  border: 1px dashed var(--line-strong); border-top: none;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  padding: 6px 11px; font-size: 11.5px; color: var(--ink-3);
  background: var(--bg); transition: background .12s, border-color .12s, color .12s;
}
.dz.over .dz-bar, .dz.over textarea { border-color: var(--accent); }
.dz.over .dz-bar { background: var(--accent-soft); color: var(--accent-ink); }
.dz-pick { color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Всплывающая подсказка у «?» */
.tipbox {
  position: absolute; z-index: 200; max-width: 360px;
  background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md); padding: 11px 14px;
  font-size: 12.5px; line-height: 1.55; color: var(--ink);
}

/* Подсказка «?» у прогресс-бара полноты */
.qhelp {
  /* исключение из глобального «без скруглений»: кружок-подсказка */
  width: 17px; height: 17px; border-radius: 50% !important; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-3); font-size: 11px; font-weight: 600;
  cursor: help; line-height: 1; flex-shrink: 0; padding: 0;
}
.qhelp:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }

.actions-row { display: flex; gap: 9px; margin-top: 20px; flex-wrap: wrap; }

/* Редактирование */
.edit-grid { display: grid; grid-template-columns: 170px 1fr; gap: 11px 14px; align-items: center; margin-top: 8px; }
.edit-grid label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.attr-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 16px; }
@media (max-width: 700px) { .attr-edit { grid-template-columns: 1fr; } }
.attr-edit .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; }
.attr-edit .row span { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Вход ---------- */

.login-wrap {
  min-height: 78vh; display: flex; align-items: center; justify-content: center;
}
.login-card { width: 360px; padding: 30px 30px 26px; display: flex; flex-direction: column; gap: 12px; }
.login-card .mark {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; margin-bottom: 4px;
}
.login-card h2 { font-size: 19px; font-weight: 700; }
.login-card .hint { font-size: 12px; color: var(--ink-3); }

/* ---------- Блок пользователя ---------- */

.userbox {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg);
}
.userbox .u { min-width: 0; }
.userbox .u span { display: block; font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.userbox .u small { color: var(--ink-3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; }

/* ---------- Администрирование ---------- */

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs button {
  font-family: var(--sans); font-size: 13.5px; font-weight: 500;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--ink-2); padding: 9px 14px; cursor: pointer; margin-bottom: -1px;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 600; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .7px; color: var(--ink-3); padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg); }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl select { width: auto; padding: 5px 8px; font-size: 12.5px; }

.role-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink-2);
}
.role-badge.admin { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.role-badge.editor { background: #EEF0FB; border-color: var(--indigo); color: var(--indigo); }

.admin-toolbar { display: flex; gap: 9px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.admin-toolbar input[type=text], .admin-toolbar input[type=password] { width: auto; min-width: 170px; }
.admin-toolbar select { width: auto; }

.admin-cat-tree { list-style: none; }
.admin-cat-tree .acat {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; font-size: 13px;
}
.admin-cat-tree .acat:hover { background: var(--bg); }
.admin-cat-tree .acat .nm { flex: 1; }
.admin-cat-tree .acat .cnt { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.admin-cat-tree .acat .ops { display: flex; gap: 4px; opacity: .45; }
.admin-cat-tree .acat:hover .ops { opacity: 1; }
.admin-cat-tree .acat .tgl { width: 15px; font-size: 9px; color: var(--ink-3); flex-shrink: 0; cursor: pointer; text-align: center; }
.admin-cat-tree ul { margin-left: 22px; list-style: none; }

.iconbtn {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.iconbtn:hover { background: var(--bg); color: var(--ink); }
.iconbtn.danger:hover { background: var(--danger-soft); color: var(--bad); border-color: var(--bad); }

/* ---------- Комбобокс значений свойств ---------- */

.combo { position: relative; }
.combo input { padding-right: 30px; width: 100%; }
.combo-btn {
  position: absolute; right: 1px; top: 1px; bottom: 1px; width: 27px;
  border: none; border-left: 1px solid var(--line); border-radius: 0 7px 7px 0;
  background: transparent; cursor: pointer; color: var(--ink-3); font-size: 10px;
}
.combo-btn:hover { color: var(--ink); background: var(--bg); }
.combo-pop {
  position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 260px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 4px;
}
.combo-pop .opt { padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.combo-pop .opt:hover { background: var(--bg); }
.combo-pop .opt.sel { background: var(--accent-soft); color: var(--accent-ink); }
.combo-pop .opt.none { cursor: default; color: var(--ink-3); font-size: 12px; }

/* ---------- Тосты, диалоги ---------- */

#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 500;
  padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  transform: translateY(6px); z-index: 100; max-width: 420px;
}
#toast.show { opacity: 1; transform: none; }
#toast.err { background: var(--bad); }

.loading { padding: 60px; text-align: center; font-size: 13px; color: var(--ink-3); animation: blink 1.1s infinite; }
@keyframes blink { 50% { opacity: .4; } }

.grid .pcard { animation: rise .22s both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

dialog {
  margin: auto;
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md); background: var(--surface);
  padding: 24px; max-width: 480px; width: 92vw;
}
dialog::backdrop { background: rgba(27, 31, 30, .4); }
dialog h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }

.modal-body { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.modal-body label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: -6px; }
.modal-body p { font-size: 13.5px; }
.form-err { color: var(--bad); min-height: 17px; margin-top: 8px; }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-solid:hover { background: #9c2f25; border-color: #9c2f25; }

.warn-banner {
  background: #FCF4E3; border: 1px solid #E3C57E; border-radius: var(--r-sm);
  color: #7A5200; font-size: 13px; padding: 10px 14px; margin-bottom: 14px;
}

/* Мини-список выбора в модалке (слияние брендов) */
.pick-list { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.pick-list label { display: flex; align-items: center; gap: 9px; padding: 7px 11px; cursor: pointer; font-size: 13px; margin: 0; color: var(--ink); font-weight: 400; }
.pick-list label:hover { background: var(--bg); }
.pick-list input { width: auto; accent-color: var(--accent); }
.pick-list .c { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
