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

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  background: #f0f2f5;
  color: #222;
  line-height: 1.5;
}

/* ─── Навигация ─────────────────────────────────────────── */
.navbar {
  background: #1a2236;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 48px;
  gap: 20px;
}
.navbar .brand {
  font-weight: bold;
  font-size: 16px;
  color: #7eb8f7;
  text-decoration: none;
  white-space: nowrap;
}
.navbar ul { list-style: none; display: flex; gap: 4px; flex-wrap: wrap; }
.navbar ul a {
  color: #cdd3de;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
}
.navbar ul a:hover, .navbar ul a.active {
  background: #2e4070;
  color: #fff;
}
.navbar ul a.nav-aggregated {
  color: #fbbf24;
  font-weight: 600;
  border: 1px solid #78530a;
  background: rgba(251,191,36,.10);
}
.navbar ul a.nav-aggregated:hover, .navbar ul a.nav-aggregated.active {
  background: #92400e;
  color: #fef3c7;
  border-color: #92400e;
}
.navbar ul a.nav-categories {
  color: #fff;
  font-weight: 600;
  border: 1px solid #6d28d9;
  background: #7c3aed;
}
.navbar ul a.nav-categories:hover, .navbar ul a.nav-categories.active {
  background: #5b21b6;
  color: #fff;
  border-color: #5b21b6;
}
.navbar ul a.nav-mapping {
  color: #713f12;
  font-weight: 600;
  border: 1px solid #a16207;
  background: #fde047;
}
.navbar ul a.nav-mapping:hover, .navbar ul a.nav-mapping.active {
  background: #eab308;
  color: #422006;
  border-color: #a16207;
}
.navbar ul a.nav-aggregated--green {
  color: #fff;
  font-weight: 600;
  border: 1px solid #166534;
  background: #16a34a;
}
.navbar ul a.nav-aggregated--green:hover, .navbar ul a.nav-aggregated--green.active {
  background: #15803d;
  color: #fff;
  border-color: #15803d;
}

/* ─── Основной контейнер ────────────────────────────────── */
.main-wrap {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 20px 60px;
}

/* ─── Хлебные крошки ───────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 14px;
  color: #94a3b8;
}
.breadcrumb a {
  color: #7c3aed;
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: #cbd5e1; }
.breadcrumb span:last-child { color: #475569; }

/* ─── Заголовки страниц ─────────────────────────────────── */
h1 { font-size: 22px; margin-bottom: 20px; color: #1a2236; }
h1 small { font-size: 14px; color: #666; font-weight: normal; }
h2 { font-size: 17px; margin: 20px 0 12px; color: #1a2236; }
h3 { font-size: 14px; margin: 16px 0 8px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ─── Алерты ────────────────────────────────────────────── */
.alert {
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ─── Кнопки ────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 7px 18px;
  background: #2e6dd6;
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.btn:hover { background: #1d56b0; }
.btn-outline {
  background: transparent;
  color: #2e6dd6;
  border: 1px solid #2e6dd6;
}
.btn-outline:hover { background: #e8f0fc; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-reimport { background: #0e7490; color: #fff; border-color: #0e7490; }
.btn-reimport:hover { background: #0c5f78; border-color: #0c5f78; }

/* ─── Таблицы ───────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 20px; }
thead { background: #1a2236; color: #fff; }
thead th { padding: 10px 12px; font-size: 12px; text-align: left; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tbody tr { border-bottom: 1px solid #edf0f5; }
tbody tr:hover { background: #f7f9fc; }
tbody td { padding: 8px 12px; font-size: 13px; }
.table-scroll { overflow-x: auto; }

.row-mapped td:first-child { border-left: 3px solid #28a745; }
.row-pending td:first-child { border-left: 3px solid #ffc107; }

.actions a { margin-left: 8px; color: #666; text-decoration: none; font-size: 15px; }
.actions a:hover { color: #2e6dd6; }
.actions .del:hover { color: #c0392b; }

/* ─── Формы ─────────────────────────────────────────────── */
.or-divider {
  text-align: center;
  color: #aaa;
  font-size: 13px;
  margin: 20px 0;
  max-width: 600px;
}
.form-card {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  padding: 24px;
  max-width: 600px;
  margin-bottom: 20px;
}
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 13px; color: #444; }
.req { color: #c0392b; }
input[type="text"], input[type="email"], input[type="number"], input[type="file"],
input[type="password"],
select, textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccd0d5;
  border-radius: 5px;
  font-size: 13px;
  color: #333;
  background: #fafafa;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #4a90e2; background: #fff; }
.hint { font-size: 12px; color: #888; margin-top: 4px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; }

/* ─── Фильтр-бар ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar input[type="text"] { max-width: 240px; }
.filter-bar select { width: auto; }

/* ─── Дашборд ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.stat-card.stat-warn { border-left: 4px solid #ffc107; }
.stat-num { font-size: 28px; font-weight: bold; color: #1a2236; }
.stat-label { font-size: 12px; color: #666; margin: 4px 0 8px; }
.stat-card a { font-size: 12px; color: #2e6dd6; text-decoration: none; }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── Progress bar ──────────────────────────────────────── */
.progress-bar {
  background: #e0e5ec;
  border-radius: 4px;
  height: 8px;
  margin-top: 6px;
  overflow: hidden;
}
.progress-bar.small { height: 5px; margin-top: 4px; }
.progress-bar div { background: #28a745; height: 100%; border-radius: 4px; transition: width .3s; }

/* ─── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}
.badge-pending    { background: #fff3cd; color: #856404; }
.badge-processing { background: #cce5ff; color: #004085; }
.badge-done       { background: #d4edda; color: #155724; }
.badge-warn       { background: #ffc107; color: #222; }

/* ─── Очередь маппинга ──────────────────────────────────── */
.map-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #dde1e7;
  padding: 16px 16px 16px 40px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  position: relative;
}
.map-raw { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.map-raw strong { font-size: 15px; }
.tag {
  display: inline-block;
  background: #e8f0fc;
  color: #2e6dd6;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  margin-right: 8px;
}
.price { font-size: 13px; color: #666; margin-left: 10px; }

.suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.suggest-form { display: inline; }
.btn-suggest {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 12px;
  transition: background .15s;
}
.btn-suggest:hover { background: #e0e5ec; }
.btn-suggest.high { border-color: #28a745; background: #d4edda; }
.btn-suggest.high:hover { background: #c3e6cb; }
.btn-suggest.mid  { border-color: #ffc107; background: #fff3cd; }
.btn-suggest.low  { border-color: #f5c6cb; background: #f8d7da; }
.conf { font-size: 10px; color: #666; margin-left: 5px; }

details { margin-top: 8px; }
details summary { font-size: 12px; color: #2e6dd6; cursor: pointer; user-select: none; }
.inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.inline-form input[type="text"] { width: auto; flex: 1; min-width: 200px; }
.inline-form select { width: auto; }

.search-results { position: relative; }
.sr-item {
  background: #fff;
  border: 1px solid #dde1e7;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}
.sr-item:hover { background: #f0f4fc; }

.empty-state { text-align: center; padding: 40px; color: #666; }

/* ─── Предпросмотр CSV ──────────────────────────────────── */
.preview-wrap {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.preview-table { font-size: 12px; }
.preview-table .row-head { background: #f0f4fc; font-weight: bold; }
.col-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.col-map-grid .form-group { margin: 0; }

/* ─── Атрибуты ──────────────────────────────────────────── */
.attr-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  padding: 6px 8px;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.attr-row:hover { background: #f7f9fc; border-color: #dde1e7; }
.attr-row input[type="text"] { flex: 1; min-width: 120px; }
.btn-del-attr {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}

/* Drag-and-drop для строк атрибутов */
.attr-drag-handle {
  cursor: grab;
  color: #bbb;
  font-size: 14px;
  user-select: none;
  flex-shrink: 0;
}
.attr-drag-handle:active { cursor: grabbing; }
.attr-dragging { opacity: 0.45; background: #e8f0fc !important; }
.attr-drag-over { border-top: 2px solid #2e6dd6 !important; }

/* Чекбокс "Главный атрибут" */
.attr-main-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: normal;
  color: #888;
  cursor: pointer;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: #fafafa;
  transition: all 0.15s;
  user-select: none;
}
.attr-main-label:hover { border-color: #f0b429; color: #8a5a00; background: #fef8e6; }
.attr-main-label.is-main-active {
  background: #fff8e1;
  border-color: #f0b429;
  color: #8a5a00;
  font-weight: bold;
}
.attr-main-label input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }

.attr-table { max-width: 400px; margin-bottom: 16px; }
.attr-edit { max-width: 600px; margin-bottom: 16px; }

/* ─── Карточка товара ───────────────────────────────────── */
.product-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; }
.product-meta { background: #fff; border-radius: 8px; padding: 16px; border: 1px solid #dde1e7; align-self: start; }
.meta-row { margin-bottom: 10px; font-size: 13px; }
.prices-block { }

/* ─── Пагинация ─────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; margin-top: 16px; align-items: center; width: 100%; }
.pagination a {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #dde1e7;
  border-radius: 4px;
  text-decoration: none;
  color: #2e6dd6;
  font-size: 13px;
  background: #fff;
}
.pagination a:hover { background: #e8f0fc; }
.pagination a.active { background: #2e6dd6; color: #fff; border-color: #2e6dd6; pointer-events: none; }
.pg-pages { display: flex; gap: 4px; flex: 1; justify-content: center; flex-wrap: wrap; }
.pg-arrow { padding: 4px 10px; font-size: 13px; }
.pg-disabled {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  color: #bbb;
  cursor: default;
  user-select: none;
}
.pg-dots {
  display: inline-block;
  padding: 4px 4px;
  font-size: 13px;
  color: #aaa;
  user-select: none;
}
.pg-info {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  align-self: center;
}

/* ─── Tooltip (иконка ℹ с подсказкой) ──────────────────── */
.tooltip-wrap {
  position: relative;
  display: inline-block;
  cursor: help;
}
.info-icon {
  color: #2e6dd6;
  font-size: 15px;
  font-style: normal;
}
.tooltip-box {
  display: none;
  position: fixed;
  background: #1a2236;
  color: #f0f2f5;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  max-width: 320px;
  min-width: 180px;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  pointer-events: none;
}

/* ─── Форма поставщика — 2 колонки ─────────────────────── */
.form-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cities-cell { max-width: 180px; font-size: 12px; }

/* Мультиполя телефон / email в форме поставщика */
.multi-input-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.multi-input-row  { display: flex; gap: 6px; align-items: center; }
.multi-input-row input { flex: 1; }
.btn-del-row {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 15px;
  padding: 0 4px;
  flex-shrink: 0;
}
.btn-del-row:hover { opacity: 0.7; }
.multi-add-btn { margin-top: 2px; }

/* Контакты в таблице поставщиков */
.supplier-contacts { font-size: 12px; }
.supplier-contacts a { display: block; color: #2e6dd6; text-decoration: none; white-space: nowrap; }
.supplier-contacts a:hover { text-decoration: underline; }

/* ─── Превью CSV — вертикальная прокрутка ───────────────── */
.preview-scroll {
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid #dde1e7;
  border-radius: 8px;
}
.preview-scroll thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* ─── Маппинг колонок — таблица с select в шапке ────────── */
.col-map-table thead th {
  padding: 6px 4px;
  background: #1a2236;
  vertical-align: top;
}
.col-select {
  width: 100%;
  min-width: 110px;
  font-size: 11px;
  padding: 3px 4px;
  border-radius: 4px;
  border: 1px solid #4a5a7a;
  background: #2e4070;
  color: #fff;
}
.col-select option { background: #1a2236; color: #fff; }
.col-assigned { background: #d4edda !important; }
.preview-head-row { background: #fff3cd !important; font-style: italic; }

/* ─── Категории — дерево и drag-and-drop ────────────────── */
.cat-branch { color: #aaa; margin-right: 4px; }
.drag-handle {
  cursor: grab;
  color: #bbb;
  margin-right: 6px;
  font-size: 14px;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }
.dragging { opacity: 0.45; background: #e8f0fc !important; }
.drag-over { border-top: 2px solid #2e6dd6; }

/* Переключатель сортировки */
.sort-toggle { display: flex; border: 1px solid #dde1e7; border-radius: 5px; overflow: hidden; }
.sort-btn {
  padding: 5px 12px;
  font-size: 12px;
  text-decoration: none;
  color: #444;
  background: #fff;
  border: none;
  white-space: nowrap;
}
.sort-btn + .sort-btn { border-left: 1px solid #dde1e7; }
.sort-btn.active { background: #2e6dd6; color: #fff; }
.sort-btn:hover:not(.active) { background: #f0f4fc; }

/* ─── Логин ─────────────────────────────────────────────── */
.login-page { background: #1a2236; }
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 10px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
}
.login-brand {
  text-align: center;
  margin-bottom: 16px;
}
.login-logo {
  max-height: 56px;
  width: auto;
}
.login-card h1 {
  font-size: 16px;
  font-weight: normal;
  color: #666;
  text-align: center;
  margin-bottom: 24px;
}

/* Кнопка выхода в навбаре */
.nav-logout {
  margin-left: auto;
  color: #aab4c8;
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
  padding: 4px 10px;
  border: 1px solid #3a4a6a;
  border-radius: 4px;
}
.nav-logout:hover { color: #fff; border-color: #7eb8f7; }

/* ─── Контекстные чипы в очереди маппинга ──────────────── */
.map-context {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 10px;
}
.ctx-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  background: #f0f2f5;
  color: #444;
  border: 1px solid #dde1e7;
}
.ctx-std   { background: #e8f4fd; color: #1a6e9e; border-color: #b8d9ef; }
.ctx-tech  { background: #fef3e2; color: #8a5a00; border-color: #f5d48a; }
.ctx-price { background: #eafaf1; color: #1e7e34; border-color: #a8ddb8; font-weight: bold; }
.ctx-info  { background: #f0eef8; color: #5a3e9e; border-color: #c9bff0; }
.ctx-misc  { background: #f5f5f5; color: #555; border-color: #d5d5d5; }
.ctx-attr  { background: #fff8e1; color: #6d4c00; border-color: #f0c84a; }
.ctx-attr-name { font-weight: bold; opacity: 0.75; }
.ctx-catalog-conflict { background: #f8d7da; color: #842029; border-color: #f5c2c7; }

.map-catalog-warn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 4px 0 6px;
  padding: 4px 8px;
  background: #fff5f5;
  border-left: 3px solid #f5c2c7;
  border-radius: 0 6px 6px 0;
}
.catalog-warn-label {
  font-size: 11px;
  color: #842029;
  opacity: 0.8;
  white-space: nowrap;
}

/* ─── Таблица позиций прайс-листа ───────────────────────── */
.items-table td { white-space: nowrap; }
.items-table .td-name { white-space: normal; max-width: 220px; }
.items-table .td-price { text-align: right; font-variant-numeric: tabular-nums; }
.items-table .td-std { font-size: 11px; color: #555; max-width: 160px; white-space: normal; }

/* ─── Умения ─────────────────────────────────────────────── */
.skills-import {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.import-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.import-form input[type="file"] {
  width: auto;
  flex: 1;
  min-width: 220px;
}
.format-hint {
  background: #f7f9fc;
  border: 1px solid #dde1e7;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 8px;
}
.format-hint summary {
  cursor: pointer;
  font-size: 13px;
  color: #2e6dd6;
  user-select: none;
}
.code-block {
  background: #1a2236;
  color: #c8d8f0;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
.td-raw { font-family: monospace; font-size: 12px; }
.btn-icon-del {
  background: none;
  border: none;
  color: #c0392b;
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.btn-icon-del:hover { opacity: 0.7; }

/* ─── Утилиты ───────────────────────────────────────────── */
.text-muted { color: #888; font-size: 13px; margin-bottom: 10px; }
.empty { color: #888; padding: 20px 0; }

/* ─── Маппинг: заголовок группы по категории ────────────── */
.map-cat-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #dde1e7;
}
.map-cat-group-header:first-child { margin-top: 0; }
.map-cat-group-name {
  font-size: 14px;
  font-weight: bold;
  color: #1a2236;
  letter-spacing: .02em;
}

/* Тег категории на карточке (при сортировке по ID) */
.tag-cat {
  background: #eef3ff;
  color: #3a5bbf;
}

/* ─── Маппинг: блок предложений системы ────────────────── */
.map-system-match {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #eafaf1;
  border: 1px solid #a8ddb8;
  border-radius: 6px;
}
.match-label {
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}
.match-label-auto  { color: #1e7e34; }
.match-label-maybe { color: #856404; }
.match-label-none  { font-size: 12px; color: #aaa; font-style: italic; }
.match-alts-label  { font-size: 11px; color: #888; white-space: nowrap; }

.map-no-suggestions { margin-bottom: 8px; }
.manual-map .search-results { max-height: 180px; overflow-y: auto; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.1); }

/* Карточка без совпадений — лёгкий тёплый бордер */
.map-card-nomatch {
  border-color: #f0b429;
  background: #fffdf4;
}

/* Секция "Создать новый" — подсветка когда нет совпадений */
.new-product-summary-pulse {
  color: #c87000 !important;
  font-weight: bold;
}

/* Кнопка "Создать и связать" — подсветка */
@keyframes btn-create-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 112, 0, 0.5); }
  50%       { box-shadow: 0 0 0 7px rgba(200, 112, 0, 0); }
}
.btn-create-highlight {
  background: #e67e00;
  border-color: #c87000;
  animation: btn-create-pulse 1.6s ease-in-out infinite;
}
.btn-create-highlight:hover { background: #c87000; }

/* Бейдж "авто" рядом с именем */
.suggested-name-hint {
  display: inline-block;
  font-size: 11px;
  color: #8a5a00;
  background: #fff8e1;
  border: 1px solid #f0b429;
  border-radius: 10px;
  padding: 1px 7px;
  white-space: nowrap;
  cursor: default;
}

/* ─── Маппинг: кнопка игнорировать ─────────────────────── */
.ignore-form { display: inline; margin-left: auto; }
.btn-ignore {
  background: none;
  border: 1px solid #e0c0c0;
  color: #c0392b;
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.btn-ignore:hover { opacity: 1; background: #fdf0ef; }

/* ─── Импорт/экспорт каталога ───────────────────────────── */
.page-header-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-danger { background: transparent; color: #c0392b; border: 1px solid #c0392b; }
.btn-danger:hover { background: #fdf0ef; }
.import-panel {
  background: #f4f6fb;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.import-panel strong { display: block; margin-bottom: 6px; font-size: 14px; }
.import-row { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.hidden { display: none; }

/* ─── Bulk-action bar ───────────────────────────────────── */
.bulk-cb {
  width: 16px; height: 16px; cursor: pointer;
  accent-color: #2e6dd6;
  margin: 0 8px 0 0; flex-shrink: 0;
}
.bulk-select-all { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.map-card .bulk-cb { position: absolute; top: 14px; left: 12px; }

#bulk-bar {
  display: none;
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a2236; color: #fff;
  padding: 12px 20px; border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
  align-items: center; gap: 14px; z-index: 1000;
  white-space: nowrap;
}
#bulk-bar.bulk-bar-visible { display: flex; }
#bulk-count { font-size: 13px; opacity: .85; }

/* ─── Полноширинные страницы (Сводная) ──────────────────── */
.page-wide .main-wrap {
  max-width: none;
  padding: 0 28px 60px;
}
.page-wide #results-wrap table {
  font-size: 12px;
}
.page-wide #results-wrap thead th {
  padding: 8px 10px;
}
.page-wide #results-wrap tbody td {
  padding: 6px 10px;
}

@media (max-width: 768px) {
  .product-layout { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .navbar ul { gap: 2px; }
  .navbar ul a { padding: 3px 7px; font-size: 12px; }

  /* Полноширинные страницы на мобильном */
  .page-wide .main-wrap { padding: 0 12px 40px; }
  .page-wide .filter-bar { flex-direction: column; align-items: stretch; }
  .page-wide .filter-bar input[type="text"],
  .page-wide .filter-bar select,
  .page-wide .filter-bar .f-attr { width: 100%; max-width: none; }
  .page-wide .page-header h1 { font-size: 18px; }
}

/* Canonical value inline edit */
.canonical-alias-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.inline-canonical-form {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.canonical-input {
  flex: 1;
  min-width: 60px;
  font-size: 13px;
  padding: 3px 6px;
}

/* Alias rows */
.val-alias-row td { background: #f8f9fb; }
.alias-indent { color: #94a3b8; margin-right: 4px; }
.alias-master-badge {
  display: inline-block;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

/* Alias details dropdown */
.alias-details { position: relative; flex-shrink: 0; }
.alias-details > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
}
.alias-details > summary::marker,
.alias-details > summary::-webkit-details-marker { display: none; }
.alias-details-btn {
  font-size: 12px;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.alias-details[open] .alias-details-btn {
  background: #2e4070;
  color: #fff;
  border-color: #2e4070;
}
.alias-details-panel {
  position: absolute;
  z-index: 200;
  left: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #d0d7e3;
  border-radius: 6px;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  min-width: 280px;
}
.alias-details-panel.drop-up {
  top: auto;
  bottom: calc(100% + 4px);
}
.alias-details-panel select { width: 100%; margin-bottom: 8px; }
.alias-details-panel .btn { width: 100%; text-align: center; }

/* Attribute chips on categories page */
.attr-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.attr-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  transition: opacity .15s;
}
.attr-chip:hover { opacity: .75; }
.attr-chip-filled {
  background: #d1fae5; color: #065f46;
  border: 1px solid #6ee7b7;
}
.attr-chip-empty {
  background: #f1f5f9; color: #94a3b8;
  border: 1px solid #cbd5e1;
}
.attr-chip-count {
  background: #059669; color: #fff;
  border-radius: 8px; padding: 0 5px;
  font-size: 10px; font-weight: 700;
}

/* ── City picker ─────────────────────────────────────────── */
.city-picker { position: relative; }
.city-picker #city-search {
  width: 100%; box-sizing: border-box;
  padding: .45rem .7rem; border: 1px solid #d1d5db;
  border-radius: 6px; font-size: .95rem; margin-bottom: .4rem;
}
.city-picker #city-search:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px #bfdbfe; }
.city-dropdown {
  position: absolute; z-index: 100; left: 0; right: 0;
  background: #fff; border: 1px solid #d1d5db; border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); max-height: 240px; overflow-y: auto;
}
.city-option {
  padding: .45rem .7rem; cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-size: .9rem;
}
.city-option:hover { background: #f0f9ff; }
.city-option-region { margin-left: auto; color: #94a3b8; font-size: .8rem; white-space: nowrap; }
.city-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: .3rem; min-height: 28px; }
.city-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #eff6ff; border: 1px solid #93c5fd; border-radius: 16px;
  padding: 2px 6px 2px 8px; font-size: .85rem; color: #1e40af;
}
.city-chip button {
  background: none; border: none; cursor: pointer; color: #60a5fa;
  font-size: 1rem; line-height: 1; padding: 0 0 0 2px;
}
.city-chip button:hover { color: #1d4ed8; }

/* City chips in supplier list */
.city-chips-inline { display: flex; flex-wrap: wrap; gap: 4px; }
.city-chip-sm {
  display: inline-flex; align-items: center; gap: 2px;
  background: #f0fdf4; border: 1px solid #86efac; border-radius: 12px;
  padding: 1px 7px; font-size: .78rem; color: #166534; white-space: nowrap;
}
