:root {
  --ink: #171717;
  --wine: #4F0005;
  --gold: #9F8151;
  --cream: #EEECE0;
  --white: #ffffff;
  --border: #ddd8c8;
  --danger: #b23a2e;
  --success: #3a7a4a;
  --warn: #a8781f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--crm-font-body, 'Roboto', 'Roboto Condensed', system-ui, sans-serif);
  background: var(--cream);
  color: var(--ink);
}

.hidden { display: none !important; }

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

.sidebar {
  width: var(--crm-menu-width, 220px);
  flex-shrink: 0;
  background: var(--sidebar-bg, var(--ink));
  color: var(--sidebar-text, #fff);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-title { color: var(--gold); font-weight: 700; font-size: 16px; padding: 0 4px; }
.sidebar-user { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 4px 0; border-top: 1px solid rgba(255,255,255,0.15); font-size: 12px; color: var(--cream); }
.sidebar-user .btn { background: transparent; color: var(--cream); border-color: rgba(255,255,255,0.3); }

.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink); padding: 16px; }
.login-box { background: var(--white); border-radius: 10px; padding: 32px 28px; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); }
.login-box h1 { font-size: 18px; margin: 0; color: var(--wine); }
.login-box input { padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.login-error { color: var(--danger); font-size: 12px; }
.login-success { color: #39704c; font-size: 12px; }
.nav-menu { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--sidebar-text, #fff);
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.nav-item:hover { background: rgba(255,255,255,0.08); }
.nav-item.active { background: var(--gold); color: var(--sidebar-active-text, var(--ink)); font-weight: 600; }
.board-nav-btn { border: 1px solid rgba(255,255,255,0.25); text-align: center; }

main { flex: 1; padding: 22px 26px; min-width: 0; }

.view { display: none; }
.view.active { display: block; }

.btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--white);
  cursor: pointer;
  font-size: 13px;
}
.btn.primary { background: var(--wine); color: var(--white); border-color: var(--wine); }
.btn.danger { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn.success { background: var(--success); color: var(--white); border-color: var(--success); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.full-width { width: 100%; }

h1.page-title { font-size: 19px; margin: 0 0 16px; color: var(--wine); }
h1,h2,h3,h4,h5,h6,.page-title { font-family:var(--crm-font-heading,'Roboto Condensed',system-ui,sans-serif); }
h2.section-title { font-size: 15px; margin: 22px 0 10px; color: var(--ink); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
summary.section-title { cursor: pointer; font-size: 1.17em; font-weight: bold; margin: 0; }
details.niche-analysis-block[open] summary.section-title { margin-bottom: 10px; }

/* Dashboard */
.dash-summary { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.dash-summary .stat {
  background: var(--white); border-radius: 8px; padding: 14px 20px; min-width: 120px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dash-summary .stat .num { font-size: 24px; font-weight: 700; color: var(--wine); }
.dash-summary .stat .lbl { font-size: 12px; color: #777; }

.dash-stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 24px; }
.dash-stage-card {
  background: var(--white); border-radius: 8px; padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06); cursor: pointer;
}
.dash-stage-card h4 { margin: 0 0 8px; font-size: 13px; }
.dash-stage-card .count { font-size: 22px; font-weight: 700; }
.dash-stage-card .badges { display: flex; gap: 6px; margin-top: 6px; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 10px; }
.badge.priority { background: var(--wine); color: var(--white); }
.badge.stuck { background: var(--danger); color: var(--white); }
.badge.muted { background: var(--cream); color: #888; border: 1px solid var(--border); }
.ref-list-item.locked-field { opacity: 0.65; }

.gen-balance-badge { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 6px; background: var(--cream); border: 1px solid var(--border); color: var(--ink); }
.gen-balance-badge.gen-balance-low { background: #fdecec; border-color: var(--danger); color: var(--danger); }
.gen-balance-badge.gen-balance-error { color: #999; font-weight: 400; }

.dash-collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.dash-collection-card {
  background: var(--white); border-radius: 8px; padding: 10px 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); cursor: pointer;
}

/* Collections view */
.collections-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 320px));
  gap: 20px; justify-content: center; max-width: 700px; margin: 0 auto;
}
.collection-card {
  background: var(--white); border-radius: 12px; padding: 30px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: pointer;
  text-align: center; transition: transform 0.12s, box-shadow 0.12s;
}
.collection-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.12); }
.collection-card h3 { margin: 0 0 12px; color: var(--wine); font-size: 24px; }
.collection-summary-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 20px; }
.collection-summary-bar .pill { background: var(--white); border-radius: 14px; padding: 5px 12px; font-size: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

/* Board view */
.board-card {
  background: var(--white); border-radius: 12px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.board-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.12); }
.board-card h3 { margin: 10px 0 4px; color: var(--wine); font-size: 16px; }
.board-tile-preview {
  display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 2px; width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--border);
}
.board-tile-preview img, .board-tile-preview-empty { width: 100%; height: 100%; object-fit: cover; }
.board-tile-preview-empty { background: var(--border); }
.reference-tile[draggable="true"] { cursor: grab; }
.reference-tile.dragging { opacity: 0.4; }
.reference-tile.drag-over, .board-cell-empty.drag-over { box-shadow: 0 0 0 3px var(--wine); }

/* Доска — фиксированная сетка ячеек, не автопоток: ширина/строки заданы явно
   (150px на ячейку), пустая ячейка — такая же по размеру зона для переноса. */
.board-canvas-viewport { max-width: 100%; padding-bottom: 20px; }
.board-grid { --board-cell: 150px; --board-gap: 10px; display: grid; gap: var(--board-gap); width: max-content; }
.board-grid .reference-tile { width: var(--board-cell); }
.board-grid .reference-tile img { height: var(--board-cell); }
.board-cell-empty { width: var(--board-cell); height: var(--board-cell); border: 1px dashed var(--border); border-radius: 6px; }
.board-zoom-controls { display: flex; gap: 6px; align-items: center; }
.board-zoom-controls button { background: var(--white); border: 1px solid var(--border); border-radius: 6px; width: 30px; height: 30px; font-size: 15px; cursor: pointer; }
.board-zoom-controls button:hover { background: var(--cream); }
#board-zoom-reset { width: auto; padding: 0 8px; font-size: 11px; }

/* Table view */
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.table-scroll { overflow-x: auto; }
.table-scroll table tr:hover { background: var(--cream); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { background: var(--cream); font-weight: 600; }
tr.archived-row { opacity: 0.55; }
tr.priority-row td:first-child { border-left: 3px solid var(--wine); }
tr:hover { background: #faf9f4; cursor: pointer; }
td select { padding: 4px 6px; border: 1px solid transparent; border-radius: 4px; font-size: 13px; background: transparent; cursor: pointer; max-width: 160px; }
td select:hover { border-color: var(--border); background: var(--white); }

.stage-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 14px;
  font-size: 12px; font-weight: 600; border: none; cursor: pointer; white-space: nowrap;
}
.stage-pill:hover { filter: brightness(0.95); }
.stage-pill.gate { background: var(--wine); color: var(--white); }

.stage-dropdown-menu {
  position: fixed; z-index: 300; background: var(--white); border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18); padding: 6px; min-width: 200px; max-height: 320px;
  overflow-y: auto;
}
.stage-dropdown-option {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.stage-dropdown-option:hover { background: var(--cream); }
.stage-dropdown-option.active { background: var(--cream); font-weight: 600; }
.stage-dropdown-option.muted { color: #888; font-style: italic; }
.stage-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid; flex: none; }
.stage-dropdown-divider { height: 1px; background: var(--border); margin: 4px 6px; }
.stage-dropdown-date-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.stage-dropdown-date { font-size: 12px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 4px; }
.stage-dropdown-add-form { display: flex; gap: 6px; align-items: center; padding: 6px 8px; }
.stage-dropdown-add-form .stage-add-name { flex: 1; min-width: 0; padding: 5px 7px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }
.stage-dropdown-add-form .stage-add-color { width: 30px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; }
.status-archived { color: var(--danger); font-weight: 600; }
.status-wholesale { color: var(--success); font-weight: 600; }
.priority-star { color: var(--wine); }

.filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
/* Заметная подпись «показаны не все товары», когда включён отбор — иначе пустой
   канбан выглядит как сломанный сайт (Наташа, 28.09). */
.filters-active-note { background: #faf1d9; border: 1px solid var(--gold); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 12px; }
.search-input { display: block; width: 100%; max-width: 360px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; margin-bottom: 10px; font-family: inherit; }
.search-input:focus { outline: none; border-color: var(--gold); }
.subview-switch { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.subview-switch button { padding: 6px 14px; border-radius: 4px; border: 1px solid var(--border); background: var(--white); cursor: pointer; font-size: 13px; }
.subview-switch button.active { background: var(--ink); color: var(--white); }

/* Kanban */
/* Полоса-прокрутка сверху должна быть видна ВСЕГДА, а не только во время скролла —
   на Mac/трекпаде системный скроллбар по умолчанию появляется только при движении,
   и никакая покраска через ::-webkit-scrollbar/scrollbar-color этого не меняет.
   Поэтому это не системный скроллбар, а собственный трек+бегунок на обычных div,
   которые двигает JS (перетаскивание мышью/пальцем + клик по треку) — так что он
   гарантированно виден с самого начала на любой ОС и любом браузере. */
.kanban-scrollbar-track {
  position: relative; height: 14px; margin-bottom: 8px;
  background: var(--cream); border-radius: 7px; cursor: pointer;
}
.kanban-scrollbar-thumb {
  position: absolute; top: 0; left: 0; height: 100%; min-width: 40px;
  background: var(--wine); border-radius: 7px; cursor: grab;
}
.kanban-scrollbar-thumb:active { cursor: grabbing; }
.kanban-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.kanban-col { width: 290px; min-width: 290px; background: var(--white); border-radius: 6px; padding: 10px; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.kanban-col h3 { font-size: 13px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--gold); }
.kanban-col.gate h3 { border-bottom-color: var(--wine); }
.kanban-card { background: var(--cream); border-radius: 4px; padding: 8px 10px; margin-bottom: 8px; font-size: 12px; cursor: grab; border: 1px solid var(--border); overflow-wrap: break-word; }
.kanban-card.priority { border-left: 3px solid var(--wine); }
.kanban-card.dragging { opacity: 0.4; }
.kanban-col.drag-over { background: var(--cream); outline: 2px dashed var(--wine); outline-offset: -2px; }
.kanban-card .article { font-weight: 600; display: block; }
.kanban-card .meta { color: #666; font-size: 11px; }

/* Миниатюра товара в таблице */
.thumb-cell { width: 44px; padding: 4px !important; }
.row-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; display: block; background: var(--border); }
.row-thumb-empty { display: flex; align-items: center; justify-content: center; color: #999; font-size: 11px; }

/* Hover preview */
.hover-preview {
  position: fixed; z-index: 200; background: var(--ink); color: var(--white);
  padding: 10px 14px; border-radius: 8px; font-size: 12px; width: min(300px, calc(100vw - 24px)); max-width: 300px;
  pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.hover-preview.hidden { display: none; }
.hover-preview b { color: var(--gold); }
.hover-preview-thumb { display: block; width: 100%; max-height: min(360px, 48vh); object-fit: cover; border-radius: 6px; margin-bottom: 8px; }

/* Product detail (full page) */
.detail-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.meeting-toggle-btn { background: var(--white); border: 2px solid var(--border); color: #888; font-weight: 600; }
.meeting-toggle-btn.active { background: var(--wine); border-color: var(--wine); color: var(--white); }

/* Вкладки карточки товара — как во вкладках браузера: ряд «корешков», привязанный к панели снизу */
.product-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.product-tabs button {
  padding: 9px 18px 8px; border: 1px solid var(--border); border-bottom: none;
  border-radius: 8px 8px 0 0; background: var(--cream); color: var(--ink);
  font-size: 13px; cursor: pointer; position: relative; top: 1px;
}
.product-tabs button.active {
  background: var(--white); font-weight: 700; color: var(--wine);
  border-color: var(--border); box-shadow: 0 -2px 0 var(--wine) inset;
}
.product-tab-panel {
  background: var(--white); border: 1px solid var(--border); border-radius: 0 8px 8px 8px;
  padding: 18px; margin-bottom: 20px;
}
.back-btn { background: none; border: none; color: var(--wine); cursor: pointer; font-size: 13px; margin-bottom: 10px; padding: 0; }
.field-row { margin-bottom: 14px; }
.field-row label { display: block; font-size: 12px; font-weight: 600; color: #6b6553; margin-bottom: 5px; }
.field-row input, .field-row select, .field-row textarea {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: var(--cream); color: var(--ink);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field-row input:hover, .field-row select:hover, .field-row textarea:hover { border-color: #c9c2a8; }
.field-row input:focus, .field-row select:focus, .field-row textarea:focus {
  outline: none; background: var(--white); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(159, 129, 81, 0.16);
}
.field-textarea { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; min-height: 90px; line-height: 1.5; resize: vertical; background: var(--cream); color: var(--ink); transition: border-color .15s, box-shadow .15s, background .15s; }
.field-textarea:hover { border-color: #c9c2a8; }
.field-textarea:focus { outline: none; background: var(--white); border-color: var(--gold); box-shadow: 0 0 0 3px rgba(159, 129, 81, 0.16); }

.analytics-note-box { background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; }
.analytics-note-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.product-cover-photo { display: block; width: 100%; max-width: 170px; max-height: 220px; object-fit: cover; border-radius: 8px; cursor: zoom-in; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Фото слева, справа — колонка «Артикул/Название/Коллекция» и колонка
   «Категория/Тип костюма/Силуэт» (Наташа, 23.09-24.09: «расплывчато»,
   разложить по столбикам рядом с фото). */
.basic-header-block { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.basic-header-row { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.basic-photo-col { flex: 0 0 170px; }
.basic-info-cols { flex: 1 1 320px; display: flex; gap: 24px; flex-wrap: wrap; min-width: 260px; }
.basic-col { flex: 1 1 200px; min-width: 180px; }
.basic-col .field-row:last-child { margin-bottom: 0; }
.basic-header-block .actions-row { margin-top: 12px; margin-bottom: 0; }

.collapsible-section { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.collapsible-section summary { cursor: pointer; font-weight: 600; list-style: none; }
.collapsible-section summary::-webkit-details-marker { display: none; }
.collapsible-section summary::before { content: '▸'; display: inline-block; margin-right: 6px; transition: transform .15s; }
.collapsible-section[open] summary::before { transform: rotate(90deg); }
.collapsible-section .collapsible-body { margin-top: 12px; }
.input-with-suffix {
  display: flex; align-items: center; gap: 4px; width: 100%;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 4px;
}
.input-with-suffix input { flex: 1; min-width: 0; border: none; padding: 0; width: auto; }
.input-with-suffix input:focus { outline: none; }
.input-with-suffix span { color: #999; font-size: 13px; flex-shrink: 0; }
.field-open-link { margin-top: 3px; font-size: 11px; }
.field-open-link a { color: var(--wine); }

.image-gallery { display: flex; flex-wrap: wrap; gap: 10px; }

/* Фото сгруппированы: фабрика -> вид -> сами фото — свёрнуто по умолчанию, чтобы при
   нескольких фабриках/видах список не был громоздким (Наташа, 17.09). */
.photo-factory-group { background: var(--white); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.photo-factory-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 13px; }
.photo-factory-header:hover { background: var(--cream); }
.photo-factory-group.collapsed .photo-factory-header .collapse-arrow { transform: rotate(-90deg); }
.photo-factory-group.collapsed .photo-factory-body { display: none; }
.photo-factory-body { padding: 10px 14px; border-top: 1px solid var(--border); }
.photo-kind-group { margin-bottom: 8px; }
.photo-kind-header { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 13px; }
.photo-kind-group.collapsed .photo-kind-header .collapse-arrow { transform: rotate(-90deg); }
.photo-kind-group.collapsed .photo-kind-body { display: none; }
.photo-kind-body { padding: 6px 0 4px 20px; }
.image-tile { position: relative; width: 120px; }
.image-tile img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.image-tile .remove-btn { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6); color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 12px; }
.image-tile .board-select-cb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; cursor: pointer; }
.board-bulk-bar { margin-bottom: 6px; }
.image-tile .add-note { font-size: 11px; color: #777; }
.image-tile .edit-meta-btn { position: absolute; bottom: 2px; right: 2px; background: rgba(0,0,0,0.6); color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 11px; padding: 0; }
.image-tile .photo-caption { margin-top: 3px; font-size: 10px; color: #777; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.image-tile .photo-caption:hover { color: var(--gold); }
.image-tile .photo-icon-row { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.image-tile .photo-icon-row .icon-btn { width: 22px; height: 22px; font-size: 12px; }

.variant-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.variant-tile { position: relative; background: var(--white); border-radius: 6px; padding: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); border: 2px solid transparent; }
.variant-tile.approved { border-color: var(--success); }
.variant-tile.rejected { border-color: var(--danger); }
.variant-tile.rejected img { opacity: 0.45; }
.variant-tile.rejected::after {
  content: '✕'; position: absolute; top: 6px; left: 6px; right: 6px; height: 110px;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-size: 52px; font-weight: 700; color: var(--danger); text-shadow: 0 0 8px rgba(255,255,255,0.9);
}
.variant-tile img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; margin-bottom: 4px; }
.variant-tile .note { font-size: 11px; color: #666; margin-bottom: 4px; min-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.variant-actions { display: flex; gap: 4px; justify-content: center; }
.icon-btn {
  flex: none; width: 26px; height: 26px; padding: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; border-radius: 4px; border: 1px solid var(--border); background: var(--white); cursor: pointer;
}
.icon-btn.danger { border-color: var(--danger); background: #fff0f0; }
.icon-btn.success { border-color: var(--success); background: #f0fbf3; }
.icon-btn:hover { filter: brightness(0.96); }

.approval-stepper { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.approval-step { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; background: var(--white); border-left: 4px solid var(--border); font-size: 13px; }
.approval-step.done { border-left-color: var(--success); }
.approval-step.pending { border-left-color: var(--warn); }
.approval-step .step-label { font-weight: 600; flex: 1; }
.approval-step .step-info { color: #777; font-size: 12px; }

.history-feed-item { display: flex; gap: 10px; border-left: 3px solid var(--gold); padding: 5px 10px; margin-bottom: 6px; font-size: 12px; }
.history-feed-date { color: #888; white-space: nowrap; flex: none; }

.actions-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; align-items: center; }

.quote-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }

.ref-section { background: var(--white); padding: 16px; border-radius: 6px; margin-bottom: 16px; }
.ref-section h2 { margin-top: 0; font-size: 15px; color: var(--wine); }
.ref-list-item { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; gap: 10px; }
.color-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); vertical-align: middle; margin-right: 6px; }

.ref-section textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 4px;
  font-size: 13px; font-family: inherit; resize: vertical;
}
.save-indicator { font-size: 11px; font-weight: 400; color: var(--success); opacity: 0; transition: opacity 0.3s; }
.save-indicator.show { opacity: 1; }

/* Settings tile grid */
.settings-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, 190px); gap: 16px;
  justify-content: center; margin: 24px 0 28px;
}
.settings-tile {
  background: var(--white); border-radius: 10px; padding: 24px 16px; text-align: center;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform 0.12s, border-color 0.12s;
}
.settings-tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.settings-tile .tile-icon { font-size: 30px; }
.settings-tile .tile-label { font-size: 14px; font-weight: 700; color: var(--ink); }
.settings-tile .tile-desc { font-size: 11px; color: #888; line-height: 1.4; }
#gen-type-tiles { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 480px) { #gen-type-tiles { grid-template-columns: 1fr; } }

/* Раздел библиотеки моделей («База» / «Из жизни») в заявках генерации — компактнее
   settings-tile, т.к. это просто переключатель раздела, а не выбор типа заявки. */
.model-category-tiles { display: flex; gap: 8px; }
.model-category-tile {
  flex: 1; background: var(--white); border-radius: 8px; padding: 10px 12px; text-align: center;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.model-category-tile .tile-icon { font-size: 16px; }
.model-category-tile .tile-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.model-category-tile.active { border-color: var(--wine); background: var(--cream); }

.settings-back { background: none; border: none; color: var(--wine); cursor: pointer; font-size: 13px; margin-bottom: 14px; padding: 0; }
.settings-intro { color: #777; font-size: 13px; margin: -8px 0 20px; }

/* Generation workspace + reference library */
.tag-group-card {
  background: var(--white); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.tag-group-card .tag-group-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.tag-group-card h4 { font-size: 13px; margin: 0; color: var(--wine); font-weight: 700; }

/* Заявка на генерацию — компактная карточка */
.gen-card-actions { display: flex; gap: 6px; }
.gen-card-actions .btn { padding: 5px 10px; font-size: 11px; }
.gen-card-actions .icon-btn { width: 26px; height: 26px; font-size: 13px; }
.gen-more-toggle { font-size: 11px; color: #888; margin-top: 8px; }
.gen-more-toggle summary { cursor: pointer; display: list-item; }
.gen-more-toggle summary:hover { color: var(--wine); }
.gen-manual-upload { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.gen-manual-upload input[type="file"] { font-size: 11px; max-width: 160px; }
.gen-prompt-box { font-size: 11px; color: #888; margin-top: 6px; white-space: pre-wrap; }
.tag-add-row { display: flex; gap: 8px; margin-top: 10px; }
.tag-add-row input { flex: 1; padding: 6px 9px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; margin: 0 6px 6px 0; border-radius: 14px;
  border: 1px solid var(--border); background: var(--cream); cursor: pointer; font-size: 12px;
}
.tag-chip.selected { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.tag-chip .tag-remove { color: #999; font-weight: 700; cursor: pointer; }
.tag-chip .tag-remove:hover { color: var(--danger); }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.reference-tile { background: var(--white); border-radius: 6px; padding: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); position: relative; }
.reference-tile.selected-ref { outline: 3px solid var(--wine); outline-offset: -3px; }
.pantone-tile.selected-ref, .settings-tile.selected-ref { outline: 3px solid var(--wine); outline-offset: -3px; }
.btn.small[disabled] { opacity: 0.4; cursor: default; }
.reference-tile img { width: 100%; height: 140px; object-fit: cover; border-radius: 4px; }
.reference-tile .remove-btn { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.6); color: white; border: none; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: 12px; }
.reference-tile .reference-tags { font-size: 10px; color: #888; margin-top: 5px; line-height: 1.3; }

/* Маленькие квадратики-миниатюры для выбора ткани в Кратком ТЗ — видно сразу, без
   необходимости печатать запрос в поиске (по просьбе Наташи). */
.fabric-swatch-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.fabric-swatch { width: 44px; height: 44px; border-radius: 4px; overflow: hidden; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.fabric-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fabric-swatch.selected { border-color: var(--wine); }

/* Пикер фото из карточки товара (для заявок генерации) */
.pip-product-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; border-bottom: 1px solid var(--border); }
.pip-product-row:last-child { border-bottom: none; }
.pip-product-row:hover { background: var(--cream); }
.pip-product-row.selected-ref { background: var(--cream); font-weight: 600; }
.pip-product-row img, .pip-product-row-noimg { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; background: var(--border); flex-shrink: 0; }

/* Pantone: компактные цветные плитки, разворачиваются по клику */
.pantone-grid { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.pantone-tile {
  width: 64px; height: 64px; border-radius: 8px; cursor: pointer; position: relative;
  border: 1px solid rgba(0,0,0,0.15); box-sizing: border-box; overflow: hidden;
  transition: width .15s ease, height .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 5px;
}
.pantone-tile:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.pantone-tile-code { font-size: 10px; font-weight: 700; line-height: 1.25; word-break: break-word; }
.pantone-tile-details { display: none; margin-top: 6px; }
.pantone-tile.expanded {
  width: 210px; height: auto; min-height: 64px; padding: 10px; z-index: 5;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.pantone-tile.expanded .pantone-tile-code { font-size: 13px; }
.pantone-tile.expanded .pantone-tile-details { display: block; }
.pantone-tile-name { font-size: 12px; margin-top: 2px; }
.pantone-tile-hex, .pantone-tile-rgb, .pantone-tile-group { font-size: 11px; opacity: 0.85; margin-top: 2px; }
.pantone-tile-edit {
  margin-top: 8px; background: transparent; border: 1px solid currentColor; border-radius: 4px;
  padding: 3px 8px; font-size: 11px; cursor: pointer; color: inherit; display: block;
}
.pantone-tile-edit:hover { background: rgba(255,255,255,0.2); }

/* Карточки выбранных тканей на вкладке «Ткани» — тот же язык, что у карточек Pantone на
   вкладке «Цвета», только вместо заливки цветом — фото образца с затемнением снизу. */
.fabric-card { position: relative; width: 170px; height: 170px; border-radius: 8px; overflow: hidden; background-size: cover; background-position: center; border: 1px solid rgba(0,0,0,0.15); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.fabric-card-scrim { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 8px; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 100%); color: #fff; }
.fabric-card-code { font-size: 13px; font-weight: 700; }
.fabric-card-name { font-size: 12px; margin-top: 2px; }
.fabric-card-meta { font-size: 11px; opacity: 0.85; margin-top: 1px; }
.fabric-card .pantone-tile-edit { margin-top: 6px; align-self: flex-start; color: #fff; border-color: #fff; }

/* Группы Pantone в заявке «Колористика» — цветная плитка на группу вместо текстового
   аккордеона; клик показывает все оттенки этой группы в отдельной сетке под ней. */
.pantone-group-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pantone-group-tile {
  width: 100px; height: 64px; border-radius: 8px; cursor: pointer; position: relative;
  border: 1px solid rgba(0,0,0,0.15); box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 6px 8px;
  transition: box-shadow .15s ease;
}
.pantone-group-tile:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.pantone-group-tile.selected-ref { outline: 3px solid var(--wine); outline-offset: -3px; }
.pantone-group-name { font-size: 12px; font-weight: 700; line-height: 1.25; }
.pantone-group-count { font-size: 10px; opacity: 0.85; }

/* Типы тканей — та же идея, что у групп Pantone, только плитка = фото первой ткани
   этого типа (переиспользует .fabric-card); клик показывает все ткани типа ниже. */
.fabric-type-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.fabric-type-tile { width: 130px; height: 90px; cursor: pointer; }
.fabric-type-tile.selected-ref { outline: 3px solid var(--wine); outline-offset: -3px; }

/* Stages accordion */
.stage-accordion-item { background: var(--white); border-radius: 8px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: hidden; }
.stage-accordion-header { display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; }
.stage-accordion-header:hover { background: var(--cream); }
.stage-accordion-header .chevron { font-size: 12px; color: var(--gold); width: 12px; flex-shrink: 0; }
.stage-accordion-header .stage-accordion-title { font-weight: 600; font-size: 13px; flex: 1; }
.stage-header-actions { display: flex; gap: 6px; flex-shrink: 0; }
.stage-accordion-item.dragging { opacity: 0.4; }
.stage-accordion-item.drag-over { box-shadow: 0 -3px 0 var(--wine); }
.stage-accordion-header .drag-handle { flex-shrink: 0; color: #bbb; cursor: grab; font-size: 15px; user-select: none; }
.stage-accordion-header .drag-handle:active { cursor: grabbing; }
.stage-accordion-body { padding: 6px 16px 18px 38px; border-top: 1px solid var(--border); }
.stage-accordion-body h4 { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.03em; margin: 14px 0 8px; }
.stage-accordion-body h4:first-child { margin-top: 6px; }
.add-reference-card { background: var(--white); border-radius: 8px; padding: 18px; margin-top: 12px; }
.add-reference-option { padding: 12px; border: 1px dashed var(--border); border-radius: 6px; margin-bottom: 10px; }
.add-reference-option label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.add-reference-or { text-align: center; font-size: 11px; color: #999; margin: 4px 0; }

/* Modal (used for new product / new collection quick forms) */
.modal-overlay { position: fixed; inset: 0; background: rgba(23,23,23,0.5); display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); overflow-y: auto; z-index: 100; box-sizing:border-box; }
.modal-overlay.hidden { display: none; }
.modal-overlay-nested { z-index: 150; }
.modal-content { background: var(--white); border-radius: 8px; padding: 24px; width: 100%; max-width: 640px; max-height:calc(100dvh - 32px); overflow-y: auto; margin:auto; overscroll-behavior:contain; }
.modal-content.modal-content-wide { max-width: 1200px; }
.modal-content h2 { margin-top: 0; color: var(--wine); }
.close-btn { float: right; background: none; border: none; font-size: 20px; cursor: pointer; }

/* Лайтбокс — увеличенный просмотр картинки (результаты генерации и т.п.) + скачивание */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(23,23,23,0.85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px 16px; z-index: 200; }
.lightbox-overlay.hidden { display: none; }
.lightbox-viewport { max-width: min(90vw, 900px); max-height: 78vh; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.lightbox-overlay img { max-width: min(90vw, 900px); max-height: 78vh; object-fit: contain; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); cursor: zoom-in; }
.lightbox-overlay img.zoomed { cursor: grab; }
.lightbox-overlay img.panning { cursor: grabbing; }
.lightbox-overlay video { max-width: min(90vw, 900px); max-height: 78vh; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,0.4); }
.lightbox-zoom-controls { display: flex; gap: 8px; align-items: center; }
.lightbox-zoom-controls button { background: rgba(255,255,255,0.15); color: var(--white); border: none; border-radius: 6px; width: 32px; height: 32px; font-size: 16px; cursor: pointer; }
.lightbox-zoom-controls button:hover { background: rgba(255,255,255,0.28); }
#lightbox-zoom-reset { width: auto; padding: 0 10px; font-size: 12px; }
.image-tile video { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); background: #000; }
.lightbox-close { position: absolute; top: 16px; right: 20px; color: var(--white); font-size: 28px; }
.lightbox-download { text-decoration: none; }
.lightbox-caption { color: var(--white); font-size: 13px; opacity: 0.85; margin-top: -6px; }
.lightbox-board-move { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); font-size: 12px; }
.lightbox-decision-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 90vw; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.12);
  border: none; color: var(--white); font-size: 32px; line-height: 1; width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
@media (max-width: 640px) { .lightbox-nav { width: 36px; height: 36px; font-size: 24px; } .lightbox-prev { left: 4px; } .lightbox-next { right: 4px; } }
.variant-tile img, .reference-tile img { cursor: zoom-in; }

.muted { color: #888; font-size: 12px; }

/* Планёрка — карточка-тред: заголовок-строка (сворачивается) + лента комментариев */
.meeting-thread-card { background: var(--white); border-radius: 8px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--border); overflow: hidden; }
.meeting-thread-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-size: 13px; }
.meeting-thread-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; flex-shrink: 0; background: var(--border); }
.meeting-thread-header:hover { background: var(--cream); }
.collapse-arrow { font-size: 10px; color: var(--gold); transition: transform .12s; }
.meeting-thread-card.collapsed .collapse-arrow { transform: rotate(-90deg); }
.meeting-thread-card.collapsed .meeting-thread-body { display: none; }
.meeting-flag { font-size: 14px; }
.meeting-thread-title { font-weight: 700; cursor: pointer; }
.meeting-thread-title:hover { color: var(--wine); }
.meeting-thread-body { padding: 12px 14px; border-top: 1px solid var(--border); }
.meeting-note-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; font-family: inherit; resize: vertical; }
.meeting-notes-list { display: flex; flex-direction: column; gap: 8px; }
.meeting-note-row { display: flex; gap: 8px; padding: 8px; border-radius: 6px; background: var(--cream); }
.meeting-note-row.resolved { background: transparent; opacity: 0.75; }
.meeting-note-flag { font-size: 15px; flex-shrink: 0; line-height: 1.4; }
.meeting-note-resolve-prompt { margin-top: 6px; }
.meeting-note-resolve-form { margin-top: 8px; padding: 8px; background: var(--white); border: 1px solid var(--gold); border-radius: 6px; }
.meeting-note-resolve-input { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; font-family: inherit; resize: vertical; }
.meeting-note-content { flex: 1; min-width: 0; }
.meeting-note-meta { font-size: 11px; margin-bottom: 2px; }
.meeting-note-text { font-size: 13px; line-height: 1.4; white-space: pre-wrap; }
.meeting-note-row.resolved .meeting-note-text { text-decoration: line-through; color: #999; }
.meeting-note-resolution { font-size: 12px; line-height: 1.4; margin-top: 4px; color: var(--success); white-space: pre-wrap; }

/* Планёрки: масштаб списка, увеличение фото и независимые вопросы без артикула */
#view-meeting .meeting-thread-card { overflow:visible; transition:box-shadow .15s ease; }
#view-meeting .meeting-thread-header { border-radius:8px; }
#view-meeting .meeting-thread-thumb { position:relative; z-index:1; cursor:zoom-in; transition:transform .16s ease,box-shadow .16s ease; transform-origin:left center; }
#view-meeting .meeting-thread-thumb:hover { z-index:20; transform:scale(2.15); box-shadow:0 5px 24px rgba(0,0,0,.28); }
#view-meeting.meeting-size-small .meeting-thread-card { margin-bottom:5px; }
#view-meeting.meeting-size-small .meeting-thread-header { min-height:34px; gap:5px; padding:5px 8px; font-size:11px; }
#view-meeting.meeting-size-small .meeting-thread-thumb { width:28px; height:32px; }
#view-meeting.meeting-size-small .meeting-thread-body { padding:7px 9px; }
#view-meeting.meeting-size-small .meeting-note-row { gap:5px; padding:5px; }
#view-meeting.meeting-size-small .meeting-note-text { font-size:11px; }
#view-meeting.meeting-size-large .meeting-thread-header { min-height:64px; padding:14px 18px; font-size:16px; }
#view-meeting.meeting-size-large .meeting-thread-thumb { width:54px; height:64px; }
#view-meeting.meeting-size-large .meeting-thread-body { padding:16px 18px; }
#view-meeting.meeting-size-large .meeting-note-text { font-size:15px; }
.meeting-flag-done { color:#247443; }
.meeting-general-agenda { margin:0 0 12px; padding:10px; border:1px solid var(--border); border-radius:9px; background:rgba(255,255,255,.48); }
.meeting-general-agenda h2 { margin:0 0 7px; font-size:15px; }
.meeting-general-agenda-list { display:grid; gap:5px; }
.meeting-general-agenda-row { display:flex; align-items:flex-start; gap:8px; padding:7px 9px; border:1px solid var(--border); border-radius:7px; background:var(--white); }
.meeting-general-agenda-main { display:grid; grid-template-columns:auto minmax(0,1fr); gap:2px 7px; flex:1; min-width:0; }
.meeting-general-agenda-main .meeting-flag { grid-row:1/3; }
.meeting-general-agenda-main small,.meeting-general-agenda-main .meeting-note-resolution { grid-column:2; }
.meeting-general-agenda-main small { color:#817968; font-size:10px; }
.meeting-general-agenda-actions { display:flex; align-items:center; gap:5px; flex-shrink:0; }
.meeting-general-agenda-row.resolved { background:#f0f7f0; }
.meeting-agenda-compose { position:relative; display:grid; grid-template-columns:150px minmax(220px,1fr) auto auto minmax(180px,260px) auto; align-items:center; gap:8px; margin:0 0 12px; padding:9px; border:1px solid var(--border); border-radius:12px; background:rgba(255,255,255,.64); }
.meeting-agenda-compose input { min-width:0; height:38px; padding:7px 11px; border:1px solid var(--border); border-radius:9px; background:#fff; color:var(--text); font:inherit; }
.meeting-agenda-add-article { height:34px; padding:5px 10px; border:1px solid var(--border); border-radius:999px; background:#fff; color:var(--text); cursor:pointer; white-space:nowrap; }
.meeting-agenda-picked { color:var(--wine); font-size:12px; cursor:pointer; white-space:nowrap; }
.meeting-agenda-product-results { position:absolute; z-index:20; margin-top:44px; max-height:260px; overflow:auto; padding:5px; border:1px solid var(--border); border-radius:10px; background:#fff; box-shadow:0 8px 28px #0002; }
.meeting-agenda-product-results button { display:flex; gap:8px; width:100%; padding:8px; border:0; border-radius:7px; background:#fff; text-align:left; cursor:pointer; }
.meeting-agenda-product-results button:hover { background:#f3efe5; }
.meeting-agenda-product-results span { color:#776f60; }
.meeting-agenda-day { margin:0 0 15px; }
.meeting-agenda-day h2 { margin:10px 0 5px; color:#82653a; font-size:14px; font-weight:700; }
.meeting-agenda-list { overflow:hidden; border:1px solid var(--border); border-radius:10px; background:#fff; }
.meeting-agenda-row { display:grid; grid-template-columns:90px minmax(200px,1.3fr) minmax(110px,.5fr) auto; align-items:center; gap:10px; min-height:37px; padding:4px 9px; border-bottom:1px solid #eeeae0; }
.meeting-agenda-row:last-child { border-bottom:0; }
.meeting-agenda-row-discussable { cursor:pointer; }
.meeting-agenda-row-discussable:hover { background:color-mix(in srgb,var(--gold) 6%,var(--white)); }
.meeting-agenda-row-discussable:focus-within { outline:2px solid color-mix(in srgb,var(--wine) 22%,transparent); outline-offset:-2px; }
.meeting-agenda-date { color:#806540; font-size:12px; white-space:nowrap; }
.meeting-agenda-date-filter { display:flex; align-items:center; gap:6px; color:#837a6b; font-size:12px; white-space:nowrap; }
.meeting-agenda-date-filter input { width:145px; padding:6px 8px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--text); font:inherit; }
.meeting-agenda-topic { display:flex; align-items:center; gap:9px; min-width:0; }
.meeting-agenda-topic-text { overflow:hidden; color:var(--text); font-size:13px; font-weight:600; text-overflow:ellipsis; white-space:nowrap; }
.meeting-agenda-edit-topic { min-width:0; cursor:text; text-decoration:underline dotted transparent; text-underline-offset:3px; transition:text-decoration-color .16s ease,color .16s ease; }
.meeting-agenda-edit-topic:hover { color:var(--wine); text-decoration-color:var(--gold); }
.meeting-agenda-entry { border-bottom:1px solid #eeeae0; }
.meeting-agenda-entry:last-child { border-bottom:0; }
.meeting-agenda-entry .meeting-agenda-row { border-bottom:0; }
.meeting-general-resolution-inline { margin:0 10px 8px; padding:9px 10px; border:1px solid var(--border); border-radius:9px; background:#fbfaf6; animation:crm-dialog-enter 180ms ease both; }
.meeting-general-resolution-readonly { display:grid; gap:4px; margin:0 10px 8px; padding:9px 12px; border-left:3px solid #769b72; border-radius:0 8px 8px 0; background:#f2f7ef; color:#394b36; font-size:13px; white-space:pre-wrap; }
.meeting-general-resolution-readonly p { margin:0; }
.meeting-agenda-row.resolved .meeting-agenda-topic-text { color:#806540; text-decoration:line-through; }
.meeting-agenda-article { flex:none; padding:2px 7px; border:0; border-radius:999px; background:#f2eddf; color:#64543b; font-size:11px; cursor:pointer; }
.meeting-agenda-meta { overflow:hidden; color:#877f70; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.meeting-agenda-actions { display:flex; align-items:center; justify-content:flex-end; gap:5px; white-space:nowrap; }
.meeting-agenda-status { display:inline-flex; align-items:center; min-height:24px; padding:3px 9px; border:0; border-radius:999px; font:inherit; font-size:11px; font-weight:500; }
button.meeting-agenda-status { cursor:pointer; }
.meeting-agenda-status.discuss { background:#fff1da; color:#a25b24; }
.meeting-agenda-status.task { background:#f0e7d5; color:#604719; }
.meeting-agenda-status.assigned { background:#e8edf8; color:#3e527b; }
.meeting-agenda-status.done,.meeting-agenda-status.discussed { background:#e8f5e9; color:#287343; }
.meeting-note-edit-small,.meeting-note-delete { padding:2px 5px; border:0; background:transparent; color:#80796e; cursor:pointer; }
.meeting-general-resolution-form { display:flex; align-items:center; gap:8px; padding:7px 10px; border-bottom:1px solid #eeeae0; background:#faf8f2; }
.meeting-general-resolution-form label { color:#746b5b; font-size:12px; white-space:nowrap; }
.meeting-general-resolution-form textarea { flex:1; min-height:32px; padding:6px 8px; border:1px solid var(--border); border-radius:7px; font:inherit; }
.meeting-general-resolution-actions { display:flex; gap:5px; }
.meeting-agenda-edit-grid { display:grid; grid-template-columns:180px minmax(0,1fr); gap:12px; }
.meeting-agenda-edit-grid label { display:grid; gap:5px; }
.meeting-agenda-edit-grid input,.meeting-agenda-edit-grid textarea { width:100%; padding:9px; border:1px solid var(--border); border-radius:8px; font:inherit; }
.meeting-task-completion { display:grid; grid-template-columns:170px minmax(0,1fr); gap:8px 12px; }
.meeting-task-completion dt { color:#827966; }.meeting-task-completion dd { margin:0; white-space:pre-wrap; }
.settings-global-visibility { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:8px; max-width:1000px; }
.settings-global-visibility > label { display:grid; grid-template-columns:auto 1fr; align-items:center; gap:5px 9px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--white); cursor:pointer; }
.settings-global-visibility > label input { grid-row:span 2; accent-color:var(--wine); }
.settings-global-visibility > label small { color:#887e6e; }
.settings-global-visibility > p { grid-column:1/-1; min-height:1em; color:#827966; }
@media(max-width:900px){.meeting-agenda-compose{grid-template-columns:145px minmax(150px,1fr) auto auto}.meeting-agenda-compose [data-meeting-product-search]{grid-column:2/4}.meeting-agenda-row{grid-template-columns:75px minmax(150px,1fr) auto}.meeting-agenda-meta{display:none}}
@media(max-width:620px){.meeting-agenda-compose{grid-template-columns:1fr auto}.meeting-agenda-compose [data-meeting-agenda-date],.meeting-agenda-compose [data-meeting-agenda-topic]{grid-column:1/-1}.meeting-agenda-row{grid-template-columns:1fr auto;gap:4px 8px;padding:7px}.meeting-agenda-date{display:none}.meeting-agenda-topic{grid-column:1/-1}.meeting-agenda-actions{grid-column:1/-1;justify-content:flex-start}.meeting-general-resolution-form{align-items:stretch;flex-direction:column}.meeting-agenda-edit-grid{grid-template-columns:1fr}}
.meeting-general-resolution-form { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; width:100%; min-width:0; margin-top:7px; padding-top:7px; border-top:1px solid var(--border); grid-column:1/-1; }
.meeting-general-resolution-form label { grid-column:1/-1; font-size:11px; font-weight:700; }
.meeting-general-resolution-form textarea { box-sizing:border-box; display:block; width:100%; min-width:0; min-height:58px; padding:9px 11px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; font-size:13px; resize:vertical; }
.meeting-general-resolution-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.meeting-general-resolution-actions .btn { width:auto; min-width:0; }
.meeting-discussion-field { display:grid; gap:7px; margin:14px 0; color:#746b5b; font-size:13px; font-weight:600; }
.meeting-discussion-field textarea { width:100%; box-sizing:border-box; min-height:110px; padding:11px 13px; border:1px solid var(--border); border-radius:10px; background:var(--white); color:var(--text); font:inherit; font-weight:400; resize:vertical; }

/* Вкладка «Конкуренты» — свёрнутая карточка показывает только фото + краткую сводку,
   разворачивается по клику на заголовок (см. .competitor-card.collapsed ниже), чтобы
   длинный список конкурентов было удобно листать. */
.competitors-list { display: flex; flex-direction: column; gap: 10px; }
.competitor-card { background: var(--white); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid var(--border); overflow: hidden; }
.competitor-card-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; font-size: 13px; }
.competitor-card-header:hover { background: var(--cream); }
.competitor-card-title { font-weight: 600; }
.competitor-card.collapsed .collapse-arrow { transform: rotate(-90deg); }
.competitor-card.collapsed .competitor-card-body { display: none; }
.competitor-card-body { padding: 14px; border-top: 1px solid var(--border); }
.competitor-thumb { width: 36px; height: 46px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); flex-shrink: 0; }
.competitor-thumb-empty { width: 36px; height: 46px; border-radius: 4px; background: var(--cream); border: 1px dashed var(--border); flex-shrink: 0; }
.competitor-fields { min-width: 0; }
@media (max-width: 480px) { .competitor-card-header { flex-wrap: wrap; } }
.competitor-history { margin-top: 12px; }
.competitor-history-title { font-size: 12px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.competitor-history-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.competitor-history-table th, .competitor-history-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.competitor-history-table th { color: #999; font-weight: 600; }

.readonly-value { padding: 7px 10px; background: var(--cream); border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.readonly-value-block { white-space: pre-wrap; line-height: 1.4; }
.competitor-auto-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; }
.competitor-auto-table th, .competitor-auto-table td { padding: 6px 10px; border: 1px solid var(--border); text-align: left; }
.competitor-auto-table th { background: var(--cream); color: #999; font-weight: 600; font-size: 11px; text-transform: uppercase; white-space: nowrap; }
.competitor-auto-table input { border: none; background: transparent; padding: 0; width: 100%; font-size: 13px; font-family: inherit; }
.cell-value-view { cursor: pointer; border-bottom: 1px dashed var(--border); }
.cell-value-view:hover { border-bottom-color: var(--gold); }
.competitor-auto-table .cell-value-input { border: none; background: transparent; padding: 0; font-size: 13px; font-family: inherit; width: 100%; }
.competitor-auto-table .cell-value-input:focus { outline: none; }
/* Поля, которые не заполняются ни одним источником автоматически — только руками */
td.competitor-manual-field, th.competitor-manual-field { background: #fdf3d0; }
/* Поле только руками (не автоматика) — жёлтая подсветка, чтобы не забывали, что сюда
   никто ничего не подставит (Наташа, договорённость + напоминание 24.09). Общий класс
   .manual-field — то же самое, что .competitor-manual-field, для полей вне карточки
   конкурента (ниша, чек-лист аналитики). */
.field-row.competitor-manual-field, .field-row.manual-field { background: #fdf3d0; padding: 8px; border-radius: 6px; margin-bottom: 10px; }
.competitor-period-add-title { font-size: 12px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
/* Период анализа — всегда виден и предзаполнен (не тихий дефолт за кнопкой), можно
   поправить даты до клика «Обновить». */
.competitor-period-picker { margin-top: 14px; padding: 10px 12px; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; }
.competitor-period-picker-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.competitor-period-input { padding: 6px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 5px; background: var(--white); }
.competitor-period-dash { color: #999; }

/* Анализ ниши (вкладка «Конкуренты») + свёрнутые доп. разрезы MPSTAT по конкуренту */
.niche-analysis-block { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 18px; }
.niche-item { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-top: 10px; background: var(--cream); }
.niche-item summary { cursor: pointer; font-weight: 600; }
.niche-item-updated { font-weight: 400; font-size: 11px; margin-left: 8px; }
.niche-item[open] { background: var(--white); }
.niche-suggestions { position: absolute; z-index: 20; top: 100%; left: 0; right: 0; background: var(--white); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); max-height: 220px; overflow-y: auto; }
.niche-suggestion { padding: 6px 10px; font-size: 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.niche-suggestion:last-child { border-bottom: none; }
.niche-suggestion:hover { background: var(--cream); }
.niche-subtitle { font-size: 12px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.03em; margin: 14px 0 6px; }
.niche-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.niche-table th, .niche-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.niche-table th { color: #999; font-weight: 600; white-space: nowrap; }
.niche-item-thumb { width: 28px; height: 36px; object-fit: cover; border-radius: 3px; vertical-align: middle; }
.niche-row-clickable { cursor: pointer; }
.niche-row-clickable:hover { background: var(--cream); }
.niche-pct-pos { color: #1c7a3c; font-weight: 600; }
.niche-pct-neg { color: #9c1c1c; font-weight: 600; }
.competitor-extra { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.competitor-extra summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.03em; }

/* Вердикт (аналитика) */
.verdict-box { background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; }
.verdict-current-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.verdict-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; background: var(--border); color: var(--ink); }
.verdict-pill.verdict-good { background: var(--success); color: var(--white); }
.verdict-pill.verdict-bad { background: var(--danger); color: var(--white); }
.verdict-pill.verdict-warn { background: var(--warn); color: var(--white); }
.verdict-comment-text { font-size: 13px; line-height: 1.4; margin-bottom: 8px; white-space: pre-wrap; }
.verdict-reason-label { font-size: 12px; font-weight: 600; color: #888; margin-bottom: 4px; }
#verdict-reason-row select { width: 100%; margin-top: 2px; }
/* [hidden] и класс с display:flex одинаковой специфичности — класс, идущий позже в
   каскаде, побеждал и показывал блок даже со стоящим hidden (реальный баг, 24.09) —
   разворачивалась заново уже открытая форма вердикта. Явный [hidden] решает. */
.verdict-buttons-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.verdict-buttons-row[hidden] { display: none; }
.verdict-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
/* Дата решения — рядом с кнопками, мелко, не бросается в глаза, но видна (24.09). */
.verdict-date-input { padding: 4px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--cream); font-size: 11px; color: #6b6553; }
.verdict-comment-form { margin-top: 10px; }
.verdict-comment-form textarea { width: 100%; }
.verdict-entry { padding: 8px 0; }
.verdict-entry + .verdict-entry { border-top: 1px dashed var(--border); }
.verdict-entry-actions { margin-left: auto; display: flex; gap: 4px; }
.verdict-entry-old .verdict-pill, .verdict-entry-old .verdict-comment-text { text-decoration: line-through; opacity: 0.6; }
.verdict-comment-edit { margin: 6px 0; }
.verdict-comment-edit textarea { width: 100%; }

/* Свёрнутая история решений (24.09) — не занимает пол-страницы, разворачивается
   по клику, чтобы посмотреть, что решали раньше по этой модели. */
.verdict-history-details { margin-bottom: 10px; }
.verdict-history-details summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #8a7a4a; list-style: none; }
.verdict-history-details summary::-webkit-details-marker { display: none; }
.verdict-history-details summary::before { content: '▸ '; }
.verdict-history-details[open] summary::before { content: '▾ '; }
.verdict-history-details .verdict-entry:first-child { padding-top: 8px; }
.verdict-new-link { display: inline-block; margin-top: 8px; background: none; border: none; padding: 0; color: var(--wine); font-size: 12px; cursor: pointer; font-family: inherit; }
.verdict-new-link:hover { text-decoration: underline; }
.verdict-new-link[hidden] { display: none; }

.verdict-choice-btn {
  padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--white); border: 1.5px solid var(--border); color: var(--ink);
}
.verdict-choice-btn.verdict-good { border-color: var(--success); color: var(--success); }
.verdict-choice-btn.verdict-good:hover, .verdict-choice-btn.verdict-good.selected { background: var(--success); color: var(--white); }
.verdict-choice-btn.verdict-bad { border-color: var(--danger); color: var(--danger); }
.verdict-choice-btn.verdict-bad:hover, .verdict-choice-btn.verdict-bad.selected { background: var(--danger); color: var(--white); }
.verdict-choice-btn.verdict-warn { border-color: var(--warn); color: var(--warn); }
.verdict-choice-btn.verdict-warn:hover, .verdict-choice-btn.verdict-warn.selected { background: var(--warn); color: var(--white); }
.verdict-choice-btn.verdict-neutral.selected { background: var(--ink); color: var(--white); }
.verdict-choice-btn.selected { box-shadow: 0 0 0 2px rgba(0,0,0,0.15) inset; }
#verdict-confirm-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* KPI-плашки «Аналитики» — компактно, не растянуто на всю ширину */
.kpi-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.kpi-cell { flex: 1; min-width: 120px; max-width: 170px; background: var(--white); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; }
.kpi-cell-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.kpi-cell label { display: block; font-size: 11px; font-weight: 600; color: var(--ink); opacity: 0.6; margin: 0; }
.kpi-value-row { display: flex; align-items: baseline; gap: 4px; }
.kpi-value-input {
  border: none; background: transparent; padding: 0; width: 100%; min-width: 0;
  font-size: 16px; font-weight: 700; color: var(--ink); font-family: inherit;
  -moz-appearance: textfield;
}
.kpi-value-input::-webkit-outer-spin-button, .kpi-value-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.kpi-value-input:focus { outline: none; border-bottom: 1px solid var(--gold); }
.kpi-unit { font-size: 16px; font-weight: 700; color: var(--ink); flex-shrink: 0; }
.kpi-cell.kpi-good { border-color: var(--success); background: #f3fbf5; }
.kpi-cell.kpi-warn { border-color: var(--warn); background: #fbf7ee; }
.kpi-cell.kpi-bad { border-color: var(--danger); background: #fbf1ef; }
.kpi-color-dot { width: 14px; height: 14px; border-radius: 50%; padding: 0; border: 1px solid var(--border); background: var(--cream); cursor: pointer; flex-shrink: 0; }
.kpi-color-dot.kpi-color-good { background: var(--success); border-color: var(--success); }
.kpi-color-dot.kpi-color-warn { background: var(--warn); border-color: var(--warn); }
.kpi-color-dot.kpi-color-bad { background: var(--danger); border-color: var(--danger); }

/* Вкладка «Поставщики» — визуальный редизайн 24.09 (логика та же, второй заход):
   компактнее (меньше паддингов), числовые колонки выровнены по правому краю все
   одинаково, разделитель перед блоком ₽/сом/¥ (это пересчёт, визуально своя
   мини-таблица), крестик удаления — мелкий и невидный, не отдельная кнопка-иконка;
   сохраняется само по blur/Enter, отдельной кнопки «Сохранить» больше нет.
   Пояснения — во всплывающей подсказке (ⓘ), не отдельным абзацем текста. */
.suppliers-table { table-layout: fixed; }
.suppliers-table th, .suppliers-table td { text-align: right; padding: 6px 8px; font-size: 12px; vertical-align: middle; }
.suppliers-table td select, .suppliers-table td input { vertical-align: middle; line-height: normal; }
.suppliers-table th:nth-child(1), .suppliers-table td:nth-child(1),
.suppliers-table th:nth-child(2), .suppliers-table td:nth-child(2) { text-align: left; }
.suppliers-table th:nth-child(6), .suppliers-table td:nth-child(6) { text-align: center; }
.suppliers-table th:nth-child(1) { width: 32%; }
.suppliers-table th:nth-child(2) { width: 16%; }
.suppliers-table th:nth-child(3), .suppliers-table th:nth-child(4), .suppliers-table th:nth-child(5) { width: 14%; }
.suppliers-table th:nth-child(6) { width: 6%; }
.suppliers-table td.num { font-variant-numeric: tabular-nums; }
.suppliers-table .supplier-conv-divider { border-left: 1px solid var(--border); }
.suppliers-table tr.best { background: #f3fbf5; }
.suppliers-table tr.best td:first-child { border-left: 3px solid var(--success); }
.suppliers-table tr:hover { cursor: default; }
.supplier-best-badge { display: inline-block; margin-left: 6px; background: var(--success); color: var(--white); font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.suppliers-table td input, .suppliers-table td select { width: 100%; padding: 3px 5px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; background: transparent; box-sizing: border-box; text-align: right; }
.suppliers-table td.supplier-name-cell input, .suppliers-table td.supplier-name-cell select { text-align: left; }
.suppliers-table td input:hover, .suppliers-table td select:hover, .suppliers-table td input:focus, .suppliers-table td select:focus { border-color: var(--border); background: var(--white); }
.suppliers-table td.actions-cell { white-space: nowrap; }
.subtle-delete-btn { background: none; border: none; color: #c2baa6; font-size: 15px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.subtle-delete-btn:hover { color: var(--danger); }
.suppliers-rate-note { font-size: 11px; margin-top: 6px; }
.suppliers-add-row { display: flex; gap: 8px; margin-top: 10px; }
.suppliers-add-row select { flex: 1; max-width: 220px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--cream); font-size: 12px; }

.purchases-table tr:hover { cursor: default; }
.purchases-table td input, .purchases-table td select { width: 100%; padding: 4px 6px; border: 1px solid transparent; border-radius: 4px; font-size: 12px; background: transparent; box-sizing: border-box; }
.purchases-table td input:hover, .purchases-table td select:hover, .purchases-table td input:focus, .purchases-table td select:focus { border-color: var(--border); background: var(--white); }
.purchases-table td.actions-cell { white-space: nowrap; }

/* Ячейки факта сами по себе — обычные, как и план (не затемняем всю колонку
   примерки заранее); цвет появляется, только когда есть что сравнить с планом:
   зелёный — совпало точно, жёлтый — в допуске (1-2см), красный — большое
   расхождение. Заливка всей ячейки, чтобы бросалось в глаза. */
.sizegrid-table td.sizegrid-fact.sizegrid-dev-exact { background: #e3f2e6; }
.sizegrid-table td.sizegrid-fact.sizegrid-dev-warn { background: #faf1d9; }
.sizegrid-table td.sizegrid-fact.sizegrid-dev-bad { background: #f9e2e2; }
.sizegrid-table td.sizegrid-cell { text-align: center; }
.sizegrid-table .cell-value-input { border: none; background: transparent; padding: 0; font-size: 13px; font-family: inherit; width: 100%; text-align: center; }
.sizegrid-table .cell-value-input:focus { outline: none; }
.sizegrid-table td.sizegrid-fact .cell-value-view { display: block; }
/* Пунктирное подчёркивание ячейки (обычно — подсказка «кликни, чтобы
   редактировать») здесь ложилось почти вплотную к обычной сплошной границе
   строки и выглядело как двойная линия/два раздела (Наташа, 24.09) — в этой
   таблице убираем подчёркивание, строка и так кликабельна для редактирования. */
.sizegrid-table .cell-value-view { border-bottom: none; }
.sizegrid-dev-inline { display: block; font-size: 10px; font-weight: 600; line-height: 1.4; color: #8a7a4a; }
/* Иконка «есть фото контроля качества этого размера+примерки» (Наташа, 24.09) —
   показывается только когда фото реально есть, поэтому маленькая и ненавязчивая,
   не должна выглядеть как обычное действие вроде плана/факта рядом. */
.sizegrid-qc-btn.icon-btn { width: 18px; height: 18px; font-size: 10px; margin: 0 auto; border-color: var(--gold); }
/* Отдельный столбик «Размер» у каждой примерки (Наташа, 25.09) — только значок
   фото контроля качества этого размера, не мерка, поэтому узкий и без ввода. */
.sizegrid-table td.sizegrid-qc-col { width: 34px; color: #bbb; }
/* Подзаголовок детали («Жакет»/«Юбка») внутри эталонной сетки составной категории —
   отделяет мерки одной детали от другой, когда у обеих есть одноимённая мерка
   (например «Обхват талии» и у жакета, и у юбки). */
.sizegrid-reference-group-row td { background: var(--cream); font-size: 12px; padding: 6px 10px; }
.sizegrid-table th.sizegrid-sub { font-weight: 400; font-size: 11px; color: #888; }
.sizegrid-color-swatch { display: inline-block; width: 22px; height: 22px; border-radius: 5px; border: 1px solid var(--border); vertical-align: middle; margin-right: 7px; }
/* Разделитель между планом и каждой следующей примеркой — иначе одна сплошная таблица */
.sizegrid-table .sizegrid-round-divider { border-left: 2px solid var(--wine, #4F0005); }
.sizegrid-table th.sizegrid-round-header-cell { position: relative; padding-right: 22px; }
.sizegrid-custom-measurement-delete { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: none; background: transparent; color: #999; font-size: 14px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.sizegrid-custom-measurement-delete:hover { color: #9c1c1c; }
.sizegrid-size-picker { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; }
.sizegrid-size-picker > .muted { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.sizegrid-size-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px 3px 6px; border-radius: 999px; background: var(--white); border: 1px solid var(--border); cursor: pointer; transition: background .15s, border-color .15s; }
.sizegrid-size-check:has(input:checked) { background: #f3ede0; border-color: var(--gold); }
.sizegrid-size-check input { accent-color: var(--wine); }

.sizegrid-color-header-row { cursor: pointer; background: var(--cream); }
.sizegrid-color-header-row:hover { background: #e6e2d4; }
.sizegrid-color-header-row td { padding: 8px 10px; font-weight: 600; }
.sizegrid-color-group .collapse-arrow { display: inline-block; transition: transform .15s; margin-right: 2px; }
.sizegrid-color-group.collapsed .collapse-arrow { transform: rotate(-90deg); }
.sizegrid-color-group.collapsed tr:not(.sizegrid-color-header-row) { display: none; }

.sizegrid-actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
/* Подпись «Сохранено»/«Не сохранилось» вместо кнопки «Сохранить» - на «Данных»
   и в размерной сетке всё сохраняется само (Наташа, 24.09). */
.save-status-note { font-size: 12px; color: var(--success, #2e7d32); }
.save-status-note.save-status-error { color: var(--danger, #c0392b); font-weight: 600; }
.sizegrid-add-btn { background: var(--cream); border: 1px solid var(--border); }
.sizegrid-add-btn:hover { background: #e6e2d4; }

/* Пилюли-чекбоксы общего назначения (24.09) — тот же язык, что sizegrid-size-check,
   но не завязан на размерную сетку: сейчас используется для выбора нескольких
   коллекций (кэрриоверы) на вкладке «Данные». */
.pill-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Специфичность .pill-picker .pill-check (2 класса) должна быть выше, чем у общего
   правила ".field-row label { display: block }" (класс+элемент) — иначе внутри
   .field-row чекбокс и подпись переносятся друг под друга (реальный баг, 24.09). */
.pill-picker .pill-check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 10px 4px 7px; border-radius: 999px; background: var(--cream); border: 1px solid var(--border); cursor: pointer; transition: background .15s, border-color .15s; margin: 0; }
.pill-picker .pill-check:has(input:checked) { background: #f3ede0; border-color: var(--gold); }
.pill-picker .pill-check input { accent-color: var(--wine); }

/* Библиотека цветов/тканей — нейтральные компактные чипы вместо крупных плиток,
   залитых сплошным цветом/фото (Наташа, 24.09: «дёшево смотрится»). Сами карточки
   уже прикреплённых цветов/тканей (pantone-tile.expanded/fabric-card) не трогаем. */
.lib-group-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.lib-group-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; border-radius: 999px; background: var(--cream); border: 1px solid var(--border); cursor: pointer; font-size: 12px; transition: background .15s, border-color .15s, box-shadow .15s; }
.lib-group-chip:hover { background: var(--white); border-color: var(--gold); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.lib-group-chip-swatch { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.12); background-size: cover; background-position: center; }
.lib-group-chip-name { font-weight: 600; }
.lib-group-chip-count { color: #8a8570; }
.lib-group-chip.active { background: #f3ede0; border-color: var(--gold); }
.lib-group-detail { background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 10px; margin-bottom: 12px; }

/* Целевые показатели по странам (24.09) — заменяют одну общую строку плашек:
   один столбик на страну, внутри те же .kpi-cell, что и раньше. */
/* Каждая страна — своя строка (название + компактные плашки горизонтально под ним,
   той же ширины, что и раньше), страны друг под другом, не растянуты на весь экран
   (Наташа, 24.09). */
/* Наташа, 24.09 (уточнение): не друг под другом — экран делится пополам, страны
   рядом, в каждой половине название сверху и три плашки горизонтально под ним. */
.kpi-countries-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.kpi-country-col { flex: 1 1 320px; background: var(--cream); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.kpi-country-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #8a7a4a; margin-bottom: 8px; }
.kpi-country-col .kpi-row { margin-bottom: 0; flex-wrap: nowrap; }
.kpi-country-col .kpi-cell { min-width: 0; }

/* Период анализа ниши (24.09) — пресеты + свой диапазон дат. */
.niche-period-picker { display: inline-flex; align-items: center; gap: 6px; }
.niche-period-picker select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }
.niche-period-custom { display: inline-flex; align-items: center; gap: 6px; }
.niche-period-custom[hidden] { display: none; }
.niche-period-custom input[type="date"] { padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; }

/* Заметка + скриншот (чек-лист «Аналитики», 24.09) — скриншот сверху, вывод (текст)
   под ним, как в реальной таблице. Слот кликабелен/фокусируется (tabindex) — так в
   него можно вставить картинку из буфера обмена (Ctrl+V), не только через «Прикрепить». */
.screenshot-note-field { border: 1px solid var(--border); border-radius: 8px; }
.screenshot-note-field textarea { margin-top: 6px; }
.screenshot-slot { display: flex; align-items: center; gap: 6px; }
/* Кнопка «с компьютера» и поле «вставить Ctrl+V» — два разных элемента (24.09: клик по
   старой единой кнопке всегда открывал диалог выбора файла, вставить было некуда). */
.screenshot-attach-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; font-size: 14px; border-radius: 6px; background: var(--white); border: 1px solid var(--border); cursor: pointer; }
.screenshot-attach-btn:hover { border-color: var(--gold); }
.screenshot-paste-area { flex: 1; min-width: 0; padding: 6px 10px; border: 1px dashed var(--border); border-radius: 6px; background: var(--white); font-size: 12px; color: #8a8570; cursor: text; outline: none; }
.screenshot-paste-area:hover { border-color: var(--gold); }
.screenshot-paste-area:focus { border-style: solid; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(159, 129, 81, 0.25); color: var(--ink); }
.screenshot-thumb { display: block; max-width: 160px; max-height: 120px; border-radius: 6px; cursor: zoom-in; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

/* Значок-подсказка — пояснение/источник показывается только при наведении (title),
   не постоянным текстом на странице (Наташа, 24.09: длинные комментарии — не в
   открытую, а всплывающей подсказкой). */
.info-tip { display: inline-block; color: #8a8570; cursor: help; font-size: 12px; }
.info-tip:hover { color: var(--gold); }

/* Поставщики — цена от поставщика + валюта в одной ячейке, число первым, валюта
   сразу за ним почти вплотную — читается одним текстом, как в колонках ₽/сом/¥
   (Наташа, 24.09: «поменять местами» и «не так далеко друг от друга»). */
.supplier-price-cell { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
.suppliers-table td.supplier-price-cell input { flex: 0 1 auto; width: 60px; text-align: right; }
.suppliers-table td.supplier-price-cell select { flex: 0 0 auto; width: auto; padding-right: 2px; border: none; background: transparent; color: inherit; }
.suppliers-table td.supplier-price-cell select:hover, .suppliers-table td.supplier-price-cell select:focus { background: var(--white); border: 1px solid var(--border); }

/* Журнал расходов на генерацию картинок (Генерация → Расходы, Наташа 30.09) */
.spend-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.spend-card { flex: 1 1 150px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.spend-card-title { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: #888; }
.spend-card-value { font-size: 22px; font-weight: 600; color: var(--wine, #4F0005); margin: 4px 0 2px; }
.spend-feed { display: flex; flex-direction: column; gap: 8px; }
.spend-row { display: flex; align-items: center; gap: 12px; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; flex-wrap: wrap; }
.spend-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; background: var(--cream); }
.spend-cost { font-weight: 600; font-size: 14px; min-width: 70px; text-align: right; }

/* ---- Канбан, редизайн 13.10: одинаковые карточки, сортировка, фильтр-воронка ---- */
.kanban-card { display: flex; flex-direction: column; gap: 4px; }
.kanban-card .article, .kanban-card .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-thumb-box { width: 100%; aspect-ratio: 3 / 4; background: #F7F5EE; border-radius: var(--crm-card-radius,4px); overflow: hidden; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.kanban-thumb { width: 100%; height: 100%; object-fit: contain; display: block; }
.kanban-thumb-empty { color: #b5ad98; font-size: 12px; }
.kanban-labels { display: flex; gap: 4px; height: 22px; overflow: hidden; flex-wrap: nowrap; }
.kanban-label { flex-shrink: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; line-height: 20px; height: 22px; padding: 0 8px; border-radius: 999px; font-weight: 600; }
.kanban-card .verdict-pill { font-size: 11px; padding: 0 8px; }
.kanban-factory-pill { color: #2E2416; border: 1px solid rgba(0,0,0,0.12); }
.kanban-label-archive { background: #E9E4E4; color: #6B4A4A; flex-shrink: 1; }
.kanban-col-head { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 6px; border-bottom: 2px solid var(--gold); margin-bottom: 10px; padding-bottom: 6px; }
.kanban-col.gate .kanban-col-head { border-bottom-color: var(--wine); }
.kanban-col-head h3 { border: none; margin: 0; padding: 0; }
.kanban-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--cream); color: #6b6250; font-size: 11px; font-weight: 600; text-align: center; }
.kanban-filter-btn { border: 1px solid transparent; background: transparent; color: #9a917c; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.kanban-filter-btn:hover { background: var(--cream); color: var(--ink); }
.kanban-filter-btn.active { background: var(--wine); color: var(--white); }
.kanban-active-filter { font-size: 11px; background: #F5EEE6; color: var(--wine); border-radius: 6px; padding: 4px 8px; margin: -4px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kanban-active-filter-x { border: none; background: none; color: var(--wine); cursor: pointer; font-size: 12px; padding: 0 2px; }
.kanban-empty { color: #b5ad98; font-size: 12px; text-align: center; padding: 16px 0; }
.kanban-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.kanban-toolbar-label { font-size: 12px; color: #8a826e; }
.kanban-seg { display: inline-flex; background: var(--white); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.kanban-seg button { border: none; background: transparent; padding: 5px 14px; border-radius: 999px; font-size: 12px; cursor: pointer; color: #5c5544; }
.kanban-seg button:hover { color: var(--ink); }
.kanban-seg button.active { background: var(--ink); color: var(--white); }
.kanban-filter-popover { position: absolute; z-index: 1000; width: 280px; max-height: min(78vh, 680px); overflow-y: auto; background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 12px; }
.kfp-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #8a826e; margin-bottom: 8px; font-weight: 600; }
.kfp-options { display: flex; flex-wrap: wrap; gap: 6px; }
.kfp-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; border: 2px solid transparent; text-align: left; }
.kfp-chip:hover { border-color: rgba(0,0,0,0.25); }
.kfp-chip.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.kfp-chip.selected::before { content: '✓'; font-weight: 700; }
.kfp-chip.verdict-pill { font-size: 12px; padding: 4px 10px; }
.kfp-count { font-size: 10px; font-weight: 700; background: rgba(255,255,255,0.6); color: var(--ink); border-radius: 999px; padding: 0 6px; }
.kf-archive { background: #E9E4E4; color: #6B4A4A; }
.kf-none { background: #F1EFE8; color: #7a7262; }
.kfp-reset { margin-top: 10px; border: none; background: none; color: var(--wine); font-size: 12px; cursor: pointer; padding: 0; text-decoration: underline; }
/* Меню колонки (сортировка + фильтр) и подпись «с какого этапа ушла в архив» — 13.10 */
.kanban-filter-btn.has-sort { background: var(--cream); color: var(--wine); }
.kanban-col-sort-note { font-size: 11px; color: #8a826e; margin: -4px 0 8px; }
.kfp-section { margin-top: 12px; }
.kfp-sorts { display: flex; flex-direction: column; gap: 2px; }
.kfp-display-options { display: flex; flex-direction: column; gap: 5px; }
.kfp-display-option { display: flex; align-items: center; gap: 7px; padding: 3px 2px; font-size: 12px; color: #4a4436; cursor: pointer; }
.kfp-display-option input { margin: 0; accent-color: var(--wine); }
.kfp-sort { text-align: left; border: none; background: none; padding: 5px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; color: #4a4436; }
.kfp-sort:hover { background: var(--cream); }
.kfp-sort.selected { background: var(--ink); color: var(--white); }
.kfp-sort.selected .muted { color: #cfc8b6; }
.kanban-prev-stage { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #5c5544; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px dashed var(--border); padding-top: 5px; margin-top: 2px; }
.kanban-prev-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid; flex-shrink: 0; }
/* Вид карточек: «Крупно» (по умолчанию) / «Компактно» / «Списком» — 13.10 */
.kanban-toolbar { flex-wrap: wrap; }
.kanban-toolbar-gap { margin-left: 14px; }
.kanban-size-small .kanban-col, .kanban-size-list .kanban-col { width: 250px; min-width: 250px; }
.kanban-size-small .kanban-card { display: grid; grid-template-columns: 66px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: start; padding: 6px; }
.kanban-size-small .kanban-thumb-box { grid-column: 1; grid-row: 1 / span 4; width: 66px; margin: 0; }
.kanban-size-small .kanban-card .article { grid-column: 2; grid-row: 1; }
.kanban-size-small .kanban-card .meta { grid-column: 2; grid-row: 2; }
.kanban-size-small .kanban-labels { grid-column: 2; grid-row: 3; }
.kanban-size-small .kanban-prev-stage { grid-column: 2; grid-row: 4; border-top: none; padding-top: 0; }
.kanban-size-list .kanban-card { padding: 6px 10px; gap: 2px; margin-bottom: 6px; }
.kanban-size-list .kanban-thumb-box { display: none; }
.kanban-size-list .kanban-card .article { order: -1; }
.kanban-size-list .kanban-prev-stage { border-top: none; padding-top: 0; }
.kanban-col-head h3 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-size-list .kanban-card .meta { order: 0; }
.kanban-size-list .kanban-labels { order: 1; }
.kanban-size-list .kanban-labels:empty { display: none; }
.kanban-size-list .kanban-prev-stage { order: 2; }
.kanban-col-head h3 { display: flex; align-items: center; }
.kanban-col-title { overflow: hidden; text-overflow: ellipsis; }
.kanban-count { flex-shrink: 0; }
/* Настройки → «Статусы по этапам» (14.10) */
.stage-status-settings { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.sss-stages { display: flex; flex-direction: column; gap: 2px; background: var(--white); border-radius: 8px; padding: 6px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.sss-stage { display: flex; align-items: center; gap: 8px; border: none; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; text-align: left; color: var(--ink); }
.sss-stage:hover { background: var(--cream); }
.sss-stage.active { background: var(--ink); color: var(--white); }
.sss-stage.active .kanban-count { background: rgba(255,255,255,0.2); color: var(--white); }
.sss-stage-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sss-panel { background: var(--white); border-radius: 8px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.sss-panel h3 { margin: 0 0 6px; }
@media (max-width: 700px) { .stage-status-settings { grid-template-columns: 1fr; } }
.kanban-label-status { background: #F3E3E3; color: #7A1F2B; cursor: pointer; flex-shrink: 1; }
.kanban-label-status:hover { box-shadow: 0 0 0 1px #7A1F2B; }
.kanban-label-status.empty { background: transparent; color: #9a917c; border: 1px dashed #c9c1ac; font-weight: 500; }
.kf-status { background: #F3E3E3; color: #7A1F2B; }
.kps-label { flex-shrink: 0; color: #8a826e; }
.kps-stage { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; padding: 1px 8px; border-radius: 999px; font-size: 11px; }
/* Аналитика: скриншоты крупнее и таблица сравнения конкурентов (14.10) */
.niche-analysis-block .screenshot-thumb { max-width: min(100%, 560px); max-height: 380px; }
.competitors-view-switch { margin: 8px 0 4px; }
.compare-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--white); }
.compare-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
.compare-table th, .compare-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; text-align: left; font-size: 13px; }
.compare-table td { width: 380px; min-width: 300px; max-width: 420px; }
.compare-table tbody th { position: sticky; left: 0; z-index: 1; background: #FAF8F2; width: 170px; min-width: 170px; font-size: 12px; color: #5c5544; font-weight: 600; border-right: 1px solid var(--border); }
.compare-table thead th { background: #FAF8F2; position: sticky; top: 0; }
.compare-table thead th:first-child { position: sticky; left: 0; z-index: 2; }
.compare-head { font-weight: 700; }
.compare-photo { width: 72px; height: 96px; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 6px; }
.compare-period { font-size: 11px; font-weight: 400; }
.compare-best { background: #E3F1E6; font-weight: 700; color: #2c5e37; }
.compare-text { white-space: normal; line-height: 1.4; }
.compare-shot-row td { background: #FCFBF8; }
.compare-table .compare-shot { max-width: 100%; max-height: 460px; width: 100%; object-fit: contain; background: var(--white); }
/* Кнопки решения по варианту генерации — только у вариантов генерации; без явного
   [hidden] display:flex выше перебивал скрытие, и кнопки «В карточку товара/Отказ»
   вылезали при открытии любой картинки, например скриншота конкурента (14.10). */
.lightbox-decision-actions[hidden] { display: none; }
.compare-table td { width: 440px; min-width: 340px; max-width: 480px; }
.lightbox-zoom-controls[hidden] { display: none; }
/* Таблица сравнения — правка на месте (14.10) */
.compare-editable { cursor: text; }
.compare-editable:hover { box-shadow: inset 0 0 0 2px #d9cfb8; }
.compare-cell-editor { width: 100%; font: inherit; padding: 6px 8px; border: 2px solid var(--gold); border-radius: 6px; background: var(--white); }
.compare-shot-cell .screenshot-slot { align-items: flex-start; }
.compare-shot-cell .screenshot-thumb { max-width: 100%; max-height: 460px; width: 100%; object-fit: contain; background: var(--white); }
.compare-shot-cell .screenshot-paste-area { min-height: 90px; display: flex; align-items: center; justify-content: center; text-align: center; }
.compare-head-actions { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.compare-article-input { width: 130px; font-size: 12px; padding: 4px 6px; }
/* Общий стиль таблиц ставит overflow:hidden — из-за него не работало закрепление колонки
   с названиями строк при прокрутке вбок (14.10). */
.compare-table { overflow: visible; box-shadow: none; border-radius: 0; }
.compare-table tbody th { z-index: 3; box-shadow: 2px 0 4px rgba(0,0,0,0.06); }
.compare-shot-cell .screenshot-slot { position: relative; display: block; }
.compare-shot-cell [data-remove-screenshot] { position: absolute; top: 6px; right: 6px; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
/* Шапка колонки сравнения — аккуратные значки вместо поля и кнопки (14.10) */
.compare-head-icons { display: flex; gap: 4px; margin-top: 8px; }
.compare-icon-btn { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--white); cursor: pointer; font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; opacity: 0.75; }
.compare-icon-btn:hover { opacity: 1; border-color: #bfb49a; }
.compare-icon-btn.danger:hover { border-color: var(--danger); background: #fbecea; }
.compare-icon-btn:disabled { opacity: 0.5; cursor: wait; }
.compare-add-article { margin-top: 6px; border: 1px dashed #c9c1ac; background: transparent; color: #7a7262; border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.compare-add-article:hover { border-color: var(--gold); color: var(--ink); }
.compare-article-edit { margin-top: 6px; }
.compare-article-edit[hidden] { display: none; }
.compare-article-input { width: 160px; font-size: 13px; padding: 5px 8px; border: 2px solid var(--gold); border-radius: 6px; }
.compare-niche-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.compare-top3 { display: flex; flex-direction: column; gap: 6px; }
.compare-top-item { display: flex; gap: 8px; align-items: center; color: inherit; text-decoration: none; font-size: 12px; }
.compare-top-item img { width: 40px; height: 54px; object-fit: cover; border-radius: 4px; }
.compare-top-item:hover { text-decoration: underline; }
/* Настройки → Категории таблицей (14.10) */
.cat-table { background: var(--white); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); overflow: visible; margin-bottom: 14px; }
.cat-row { display: grid; grid-template-columns: minmax(140px, 1.1fr) 80px minmax(240px, 2fr) 150px; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.cat-row:last-child { border-bottom: none; }
.cat-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #8a826e; font-weight: 600; background: #FAF8F2; border-radius: 8px 8px 0 0; }
.cat-name { font-weight: 600; }
.cat-niche { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cat-niche-pill { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: #EEF2F7; color: #34465c; border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.cat-niche-edit { position: relative; }
.cat-niche-edit[hidden] { display: none; }
.cat-niche-edit input { width: 100%; font-size: 12px; padding: 5px 8px; border: 2px solid var(--gold); border-radius: 6px; }
.cat-actions { display: flex; gap: 4px; justify-content: flex-end; }
.compare-icon-btn[disabled] { opacity: 0.3; cursor: not-allowed; }
@media (max-width: 760px) { .cat-row { grid-template-columns: 1fr 60px; } .cat-row > :nth-child(3), .cat-row > :nth-child(4) { grid-column: 1 / -1; } .cat-head > :nth-child(3), .cat-head > :nth-child(4) { display: none; } }
/* «Товары»: панель вида и поиска + фильтры «таблетками» (14.10) */
.products-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.search-pill { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; height: 36px; flex: 1; min-width: 220px; max-width: 420px; color: #9a917c; }
.search-pill:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(159,129,81,0.15); }
.search-pill input { border: none; outline: none; background: transparent; font-size: 13px; flex: 1; padding: 0; height: 100%; color: var(--ink); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filter-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--border); border-radius: 999px; padding: 0 30px 0 14px; height: 34px; font-size: 13px; cursor: pointer; }
.filter-pill:hover { border-color: #bfb49a; }
.filter-pill::after { content: ''; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: 0.55; pointer-events: none; }
.filter-pill-label { color: #8a826e; }
.filter-pill select { appearance: none; -webkit-appearance: none; border: none; background: transparent; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; padding: 0; max-width: 180px; outline: none; }
.filter-pill.on { background: var(--ink); border-color: var(--ink); }
.filter-pill.on .filter-pill-label { color: #cfc8b6; }
.filter-pill.on select { color: var(--white); }
.filter-pill.on select option { color: var(--ink); }
.filter-pill.on::after { color: var(--white); }
.filter-reset { border: none; background: none; color: var(--wine); font-size: 13px; cursor: pointer; padding: 0 6px; }
.filter-reset:hover { text-decoration: underline; }
.cat-niche { align-items: flex-start; }
#new-category-name, #new-target-country-name, #new-stage-status-label { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); font-size: 13px; }
/* Настройки → Редактор карточки (14.10) */
.cte-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #8a826e; margin: 14px 0 6px; font-weight: 600; }
.cte-title:first-child { margin-top: 4px; }
.cte-hint { text-transform: none; letter-spacing: 0; font-weight: 400; color: #a39a85; font-size: 12px; }
.cte-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 6px; background: var(--white); border: 1px solid var(--border); margin-bottom: 4px; font-size: 13px; }
.cte-row.is-hidden { opacity: 0.55; background: #F5F3EC; }
.cte-label { min-width: 0; }
.cte-actions { display: flex; gap: 4px; flex-shrink: 0; }
.cte-lock { cursor: default; opacity: 0.6; }
.cte-add { display: flex; gap: 8px; margin-top: 8px; }
.cte-add input { flex: 1; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.stage-accordion-item.tab-hidden .stage-accordion-title { opacity: 0.5; text-decoration: line-through; }
.custom-fields-block { margin-top: 18px; }
/* Фильтр-«таблетка» нажимается целиком: прозрачный select поверх всей таблетки (15.10) */
.filter-pill-value { font-weight: 600; color: var(--ink); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-pill.on .filter-pill-value { color: var(--white); }
.filter-pill .filter-pill-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; max-width: none; font-size: 14px; }
.filter-pill:focus-within { box-shadow: 0 0 0 3px rgba(159,129,81,0.25); }
/* Настройки → Фабрики: таблица + страна с поиском по списку (15.10) */
.factory-row { grid-template-columns: minmax(160px, 1.2fr) minmax(200px, 1fr) 190px; }
.factory-row.factory-editing { background: #FFFDF6; }
.factory-name-input, .country-picker input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--white); }
.factory-name-input:focus, .country-picker input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(159,129,81,0.15); }
.country-picker { position: relative; display: block; flex: 1; min-width: 200px; }
.country-picker-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; background: var(--white); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.12); max-height: 260px; overflow-y: auto; padding: 4px; }
.country-picker-list[hidden] { display: none; }
.country-option { display: block; padding: 7px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.country-option:hover, .country-option.active { background: var(--cream); }
.country-empty { display: block; padding: 7px 10px; font-size: 12px; }
.factory-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.factory-add-row #new-factory-name { flex: 1; min-width: 180px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--white); }
.factory-add-row .country-picker input { height: 36px; border-radius: 8px; }
.factory-add-row { margin-bottom: 14px; }
/* Себестоимость: вкладка карточки и Настройки → Материалы и цены (15.10) */
.cost-items { display: flex; flex-direction: column; gap: 6px; }
.cost-item-row { display: grid; grid-template-columns: 90px minmax(220px, 1fr) 150px 34px; gap: 10px; align-items: center; background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.cost-item-kind { font-size: 12px; color: #8a826e; font-weight: 600; }
.cost-item-row select { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 6px; background: var(--white); font-size: 13px; }
.cost-item-qty { display: flex; align-items: center; gap: 6px; }
.cost-item-qty input { width: 80px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.cost-table td { width: 300px; min-width: 240px; }
.cost-sub { font-size: 11px; color: #8a826e; margin-top: 2px; }
.cost-missing { color: #a8781f; font-size: 12px; }
.cost-total-row td, .cost-total-row th { background: #FAF8F2; }
.cost-total { font-size: 18px; font-weight: 700; }
.cost-stale { color: #a8781f; }
.cost-diff { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.cost-diff-green { background: #E3F1E6; color: #2c5e37; }
.cost-diff-yellow { background: #FBF0D6; color: #8a6114; }
.cost-diff-red { background: #F8E1DE; color: #9b2c22; }
.cost-missing-box { margin-top: 10px; background: #FFF8E6; border: 1px solid #F0DDA8; border-radius: 8px; padding: 10px 12px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.kpi-material { font-size: 12px; margin-top: 6px; padding: 6px 10px; background: #F5F3EC; border-radius: 6px; }
.kpi-material a { margin-left: 6px; }
.mat-table td { width: 230px; min-width: 200px; vertical-align: middle; }
.mat-table tbody th { width: 240px; min-width: 220px; }
.mat-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.mat-name img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.mat-photo { width: 34px; height: 34px; border: 1px dashed #c9c1ac; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; font-size: 14px; overflow: hidden; }
.mat-photo img { width: 100%; height: 100%; object-fit: cover; }
.mat-price-inputs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mat-price-inputs input { width: 84px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.mat-price-inputs input.mat-pack, .mat-table input.mat-pack { width: 64px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; }
.mat-price-inputs select, .mat-table select { height: 30px; border: 1px solid var(--border); border-radius: 6px; background: var(--white); font-size: 13px; }
.mat-add-row input, .mat-add-row select { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--white); }
.mat-add-row input:first-child { flex: 1; min-width: 240px; }
.mat-table td { min-width: 300px; width: 300px; }
.mat-price-inputs { flex-wrap: nowrap; }
.mat-price-inputs input { width: 76px; }
.mat-table td.mat-actions-cell { width: 90px; min-width: 90px; }
.mat-table td.mat-narrow { width: 120px; min-width: 110px; }
/* Материалы и цены: единый экран тканей (15.10, вторая часть) */
.mat-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mat-countries { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: #8a826e; }
.mat-add-country .country-picker { min-width: 180px; }
.mat-add-country .country-picker input { height: 30px; }
.mat-filter { flex: 1; max-width: 420px; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: var(--white); }
.mat-click { cursor: pointer; }
.mat-click:hover span:first-of-type { text-decoration: underline; }
.mat-wide-text { min-width: 220px !important; width: 240px !important; font-size: 12px; }
.mat-density { width: 100%; height: 28px; margin-top: 4px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; }
.mat-table td.mat-narrow { width: 200px; min-width: 180px; }
.mat-price-inputs select[data-p-pack-unit] { width: 56px; }
.fabric-modal-photo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.fabric-modal-photo img, .fabric-modal-nophoto { width: 110px; height: 110px; object-fit: cover; border-radius: 8px; background: var(--cream); display: flex; align-items: center; justify-content: center; color: #9a917c; font-size: 12px; }
/* Краткое ТЗ: фурнитура из библиотеки (15.10) */
.tz-hw-row { display: grid; grid-template-columns: 40px minmax(160px, 1fr) 130px minmax(140px, 1fr) 30px; gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; background: var(--white); }
.tz-hw-row img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.tz-hw-name { font-size: 13px; font-weight: 600; }
.tz-hw-qty { display: flex; align-items: center; gap: 4px; }
.tz-hw-qty input { width: 70px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.tz-hw-note { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; width: 100%; }
.tz-hw-add select { width: 100%; height: 34px; border: 1px dashed #c9c1ac; border-radius: 8px; background: var(--white); font-size: 13px; padding: 0 8px; }
.mat-unit-cell { width: 210px !important; min-width: 200px !important; }
.mat-unit-cell select { width: 100%; margin-bottom: 6px; }
.mat-mini-label { display: block; font-size: 11px; color: #8a826e; font-weight: 600; margin-bottom: 3px; }
.mat-need { color: #a8781f; font-weight: 600; }
.mat-unit-cell input.mat-pack { width: 96px; }
/* Меню, плитки и карточки — настоящие ссылки (открываются в новой вкладке), 15.10 */
a.nav-item { display: block; text-decoration: none; }
/* Author display styles override the browser's default [hidden] rule on links. */
.nav-item[hidden] { display: none !important; }
a.board-nav-btn { display: block; }
a.settings-tile { text-decoration: none; color: inherit; }
a.kanban-card { color: inherit; text-decoration: none; }
a.row-link { color: inherit; text-decoration: none; }
a.row-link:hover { text-decoration: underline; }
/* Себестоимость по странам (15.10, вечер) */
.cost-country-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.cost-country-tab { border: 1px solid var(--border); background: var(--white); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cost-country-tab.active { background: var(--ink); color: var(--white); border-color: var(--ink); }
.cost-country-tab.active .kanban-count { background: rgba(255,255,255,0.2); color: var(--white); }
.cost-copy-select { height: 30px; border: 1px dashed #c9c1ac; border-radius: 6px; background: var(--white); font-size: 13px; padding: 0 8px; }
.cost-sub-light { color: #a39a85; }
.kpi-material-cell { background: #F2F4F8 !important; border-color: #D5DCE8 !important; }
.kpi-material-value { font-size: 18px; font-weight: 700; }
.kpi-material-sub { font-size: 11px; color: #6b7280; margin-top: 2px; }
.mat-country-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--cream); color: #5c5544; border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12px; font-weight: 600; }
.mat-country-chip button { border: none; background: transparent; color: #9a917c; cursor: pointer; font-size: 11px; width: 18px; height: 18px; border-radius: 50%; }
.mat-country-chip button:hover { background: #F8E1DE; color: #9b2c22; }
.kpi-material-del { color: #9b2c22 !important; }
/* Канбан: доска прокручивается сама, шапки колонок закреплены сверху (15.10) */
/* Доска — прокручиваемое окно; внутри ряд колонок высотой с самую длинную колонку,
   так что все колонки одной высоты и шапка закреплена у каждой, даже у короткой. */
.kanban-board { display: block; overflow: auto; }
.kanban-cols { display: flex; gap: 12px; align-items: stretch; width: max-content; min-height: 100%; }
.kanban-col { padding-top: 0; }
.kanban-col-head { position: sticky; top: 0; z-index: 4; background: var(--white); margin: 0 -10px 10px; padding: 10px 10px 6px; border-radius: 6px 6px 0 0; }
.pill-picker .pill-check { white-space: nowrap; }
/* Фабрики: колонка мощности (15.10) */
.factory-row { grid-template-columns: minmax(160px, 1.2fr) minmax(180px, 1fr) 150px 190px; }
.factory-cap-input { width: 110px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
/* Производства (15.10) */
.prod-col { width: 270px; min-width: 270px; }
.prod-head { flex-direction: column; align-items: stretch; border-bottom-width: 3px; }
.prod-head-green { border-bottom-color: #3a7a4a; }
.prod-head-yellow { border-bottom-color: #c9932c; }
.prod-head-red { border-bottom-color: #b23a2e; }
.prod-head-free { border-bottom-color: #c9c1ac; }
.prod-head-main { display: flex; flex-direction: column; gap: 3px; }
.prod-head-sub { font-size: 11px; color: #8a826e; display: flex; align-items: center; gap: 5px; }
.prod-head-counts { font-size: 12px; color: #5c5544; }
.prod-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.prod-dot.prod-green, .prod-load-fill.prod-green { background: #3a7a4a; }
.prod-dot.prod-yellow, .prod-load-fill.prod-yellow { background: #c9932c; }
.prod-dot.prod-red, .prod-load-fill.prod-red { background: #b23a2e; }
.prod-dot.prod-free { background: #c9c1ac; }
.prod-load { font-size: 11px; color: #5c5544; margin-top: 4px; }
.prod-load-bar { height: 6px; background: #EEE9DC; border-radius: 999px; overflow: hidden; margin-bottom: 3px; }
.prod-load-fill { display: block; height: 100%; border-radius: 999px; }
.prod-section { margin-bottom: 12px; }
.prod-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #8a826e; font-weight: 700; margin: 2px 0 6px; }
.prod-item { display: flex; gap: 8px; align-items: center; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--cream); margin-bottom: 6px; color: inherit; text-decoration: none; }
.prod-item:hover { border-color: var(--gold); }
.prod-item img, .prod-item-nophoto { width: 40px; height: 54px; object-fit: cover; border-radius: var(--crm-card-radius,4px); background: #F7F5EE; flex-shrink: 0; }
.prod-item-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; }
.prod-constructor-name { color:#665b48; font-size:11px; line-height:1.25; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.prod-constructor-filter { display:inline-flex; align-items:center; gap:7px; min-height:34px; padding:4px 10px 4px 12px; border:1px solid var(--border); border-radius:999px; background:var(--white); color:#827966; font-size:12px; white-space:nowrap; }
.prod-constructor-filter select { max-width:180px; padding:3px 18px 3px 2px; border:0; outline:0; background:transparent; color:var(--ink); font:inherit; cursor:pointer; }
.prod-display-settings { position:relative; flex:none; }
.prod-display-settings > summary { display:grid; place-items:center; width:36px; height:36px; border:1px solid var(--gold); border-radius:11px; background:var(--white); color:var(--gold); cursor:pointer; list-style:none; transition:background-color .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease; }
.prod-display-settings > summary::-webkit-details-marker { display:none; }
.prod-display-settings > summary:hover,.prod-display-settings[open] > summary { background:var(--gold); color:var(--white); box-shadow:0 3px 10px rgba(23,23,23,.12); }
.prod-display-settings > summary:active { transform:scale(.97); }
.prod-display-popover { position:absolute; z-index:30; top:calc(100% + 7px); right:0; width:260px; padding:14px 15px; border:1px solid var(--border); border-radius:13px; background:var(--white); box-shadow:0 12px 32px rgba(23,23,23,.16); color:var(--ink); }
.prod-display-heading { margin:0 0 11px; color:#938975; font-size:11px; font-weight:700; letter-spacing:.04em; }
.prod-display-popover label { display:flex; align-items:center; gap:9px; padding:6px 2px; color:var(--ink); cursor:pointer; }
.prod-display-popover input { accent-color:var(--wine); }
.prod-stage { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Конструирование → «Лекала и 3D» (15.10) */
.pfiles { display: flex; flex-direction: column; gap: 6px; }
.pfile-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--white); }
.pfile-icon { font-size: 20px; }
.pfile-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.pfile-name a { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model3d-row { display: flex; gap: 8px; align-items: center; }
.model3d-row input { flex: 1; }
/* 3D-окно и перетаскивание файлов (15.10) */
.model3d-box { margin: 4px 0 14px; }
.model3d-viewer { display: block; width: 100%; height: 520px; border: 1px solid var(--border); border-radius: 10px; background: linear-gradient(#FAF8F2, #EEE9DC); }
.pfiles-drop { border: 2px dashed transparent; border-radius: 10px; padding: 6px; transition: border-color .15s, background .15s; }
.pfiles-drop.over { border-color: var(--gold); background: #FFFBF0; }
.pfiles-drop-hint { font-size: 11px; color: #a39a85; margin-bottom: 6px; }
/* Вкладка «Конструирование» (15.10): две колонки — слева ТЗ и файлы, справа окно 3D/лекал */
.cons-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.cons-left { position: relative; min-width: 0; }
.cons-left > .section-title:first-of-type { margin-top: 2px; }
.cons-right { position: sticky; top: 12px; min-width: 0; }
@media (max-width: 1100px) { .cons-layout { grid-template-columns: 1fr; } .cons-right { position: static; } }
.cons-constructor { display: flex; align-items: center; gap: 8px; justify-content: flex-end; font-size: 12px; color: #8a8270; margin-bottom: 4px; }
.cons-constructor select { width: auto; min-width: 160px; padding: 5px 8px; font-size: 12px; border-radius: 16px; transition: box-shadow .3s; }
.cons-constructor select.saved-flash { box-shadow: 0 0 0 2px #8fbf8f; }
.tz-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
@media (max-width: 640px) { .tz-pair { grid-template-columns: 1fr; } }
.tz-card { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tz-card-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tz-card-icon { font-size: 18px; }
.tz-card-state { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #f1ede3; color: #8a8270; }
.tz-card-state.ok { background: #e6f2e6; color: #2f6b2f; }
.tz-card-body { height: 110px; border-radius: 8px; background: #FAF8F2; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tz-card-thumb { display: block; width: 100%; height: 100%; }
.tz-card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.tz-card-file { font-size: 13px; }
.tz-card-empty { font-size: 12px; color: #a39a85; padding: 0 14px; text-align: center; line-height: 1.4; }
.tz-card-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tz-card-actions .btn { margin: 0; }
.pfiles-drop { border: 2px dashed #e4dccb; border-radius: 10px; padding: 8px 10px; }
.pfiles-drop-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.pfiles-drop-foot .btn { margin: 0; }
.pfiles-drop-hint { margin: 0; }
.pfile-row.shown { background: #FFFBF0; border-radius: 8px; }
.cons-drive { margin-top: 14px; font-size: 12px; }
.cons-drive label { display: block; font-weight: 600; margin-bottom: 4px; }
.cons-drive label .muted { font-weight: 400; }
.cons-viewer { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 10px; }
.cons-viewer-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
.cons-viewer-head .kanban-seg button[disabled] { opacity: .45; cursor: not-allowed; }
.cons-viewer .model3d-viewer { height: min(70vh, 620px); }
.cons-viewer-note { font-size: 11px; color: #8a8270; margin-top: 4px; }
.cons-clo-link { margin-top: 10px; font-size: 12px; }
.cons-clo-link summary { cursor: pointer; color: #8a8270; }
.model3d-empty { height: min(70vh, 620px); border-radius: 10px; background: linear-gradient(#FAF8F2, #EEE9DC); display: flex; flex-direction: column; justify-content: center; padding: 24px 32px; font-size: 13px; line-height: 1.5; }
.model3d-empty-icon { font-size: 44px; opacity: .5; }
.model3d-empty ol { padding-left: 18px; margin: 10px 0; }
.ok-text { color: #2f6b2f; }
.pieces-view { height: min(70vh, 620px); overflow: auto; border-radius: 10px; background: #FAF8F2; padding: 10px; }
.pieces-head { font-size: 12px; margin-bottom: 8px; }
.pieces-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.piece-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border: 1px solid #ece5d6; border-radius: 8px; padding: 6px; cursor: zoom-in; font: inherit; }
.piece-tile:hover { border-color: var(--gold); }
.piece-cap { font-size: 11px; max-width: 200px; text-align: center; line-height: 1.3; display: flex; flex-direction: column; }
.piece-qty { color: #7a2e2e; }
.pieces-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; color: #8a8270; margin-top: 10px; }
.pieces-legend i { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin-right: 4px; }
.lg-cut { border-top: 2px solid #3a3328; } .lg-sew { border-top: 1px dashed #b0a283; } .lg-in { border-top: 1px solid #7a2e2e; }
.lg-grain { border-top: 1px solid #2f6f9f; } .lg-notch { width: 6px !important; height: 6px !important; border-radius: 50%; background: #7a2e2e; }
.piece-big { background: #FAF8F2; border-radius: 10px; padding: 10px; }
.piece-svg-big { width: 100%; height: 70vh; display: block; }
.cons-drive input, .cons-clo-link input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; background: #fff; }
.tz-card-actions a.btn, .cons-drive a.btn, .cons-clo-link a.btn { text-decoration: none; color: inherit; }
.cons-constructor select { border: 1px solid var(--border); background: #fff; }
.pieces-grid { align-items: flex-start; }
/* 15.10: строки лекал нажимаются целиком; конструктор — заметной плашкой */
.pfile-row.viewable { cursor: pointer; border-left: 3px solid transparent; transition: background .15s, border-color .15s; }
.pfile-row.viewable:hover { background: #FBF7EC; }
.pfile-row.shown { background: #FFF6DE; border-left-color: var(--gold); }
.pfile-row a.compare-icon-btn { text-decoration: none; color: inherit; }
.cons-constructor { width: fit-content; margin-left: auto; padding: 4px 4px 4px 12px; border-radius: 20px; font-weight: 600; }
.cons-constructor.set { background: #FFF3D6; border: 1px solid #E4C57A; color: #6b4d12; }
.cons-constructor.unset { background: #FDEDEC; border: 1px dashed #D99A94; color: #8a2f2a; }
.cons-constructor select { border-color: transparent; font-weight: 500; }
/* Загрузка фабрики в «Поставщиках» (15.10) */
.factory-load-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-size: 10px; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; text-decoration: none; border: 1px solid; }
.factory-load-badge.fl-red { background: #fbeceb; color: #962f25; border-color: #e7b5b0; }
.factory-load-badge.fl-yellow { background: #fbf3e2; color: #8a6418; border-color: #e8cf97; }
.factory-load-badge.fl-green { background: #eaf4ec; color: #2f6b3d; border-color: #b5d6bd; }
.factory-load-badge.fl-free { background: #f3f1ec; color: #7d7563; border-color: #dcd6c8; }
/* Группы файлов в «Лекала и 3D» (15.10) */
.pfile-group { margin-bottom: 6px; }
.pfile-group > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: #6f6754; padding: 4px 2px; list-style: none; }
.pfile-group > summary::-webkit-details-marker { display: none; }
.pfile-group > summary::before { content: '▸ '; color: #b0a283; }
.pfile-group[open] > summary::before { content: '▾ '; }
/* «Отделы» файлов в Конструировании (15.10): крупные свёрнутые заголовки, компактные строки */
.pfiles-drop { padding: 8px; }
.pf-sec { border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 8px; overflow: hidden; }
.pf-sec-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; list-style: none; user-select: none; }
.pf-sec-head::-webkit-details-marker { display: none; }
.pf-sec-head:hover { background: #FBF7EC; }
.pf-sec-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; background: #F4EEDF; flex: none; }
.pf-sec-patterns .pf-sec-icon { background: #F7EBD3; }
.pf-sec-spec .pf-sec-icon { background: #E8F0F7; }
.pf-sec-tech .pf-sec-icon { background: #EEF3E6; }
.pf-sec-3d .pf-sec-icon { background: #F0E9F5; }
.pf-sec-title { display: flex; flex-direction: column; font-size: 14px; font-weight: 700; color: var(--ink, #2b2620); min-width: 0; }
.pf-sec-title small { font-size: 11px; font-weight: 400; color: #8a8270; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-sec-count { margin-left: auto; min-width: 26px; text-align: center; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #F1EBDD; color: #6b5d3e; }
.pf-sec-chev { font-size: 18px; color: #b0a283; transition: transform .15s; }
.pf-sec[open] > .pf-sec-head .pf-sec-chev { transform: rotate(90deg); }
.pf-sec[open] > .pf-sec-head { border-bottom: 1px solid #efe8d8; }
.pf-sec-body { padding: 4px 6px 6px; }
.pf-sub-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #8a7a55; padding: 8px 6px 3px; }
.pf-sub-count { font-weight: 400; color: #b0a283; }
.pf-sub > summary { display: flex; align-items: baseline; gap: 8px; cursor: pointer; list-style: none; }
.pf-sub > summary::-webkit-details-marker { display: none; }
.pf-sub > summary .pf-sub-title::before { content: '▸ '; }
.pf-sub[open] > summary .pf-sub-title::before { content: '▾ '; }
.pf-sub-hint { font-size: 11px; color: #a39a85; }
.pf-sec .pfile-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px; min-height: 28px; border: none; border-left: 3px solid transparent; border-radius: 6px; margin: 1px 0; font-size: 12px; background: none; }
.pf-sec .pfile-row:hover { background: #FBF7EC; }
.pf-sec .pfile-row.shown { background: #FFF3D6; border-left-color: var(--gold); }
.pf-sec .pfile-icon { font-size: 13px; flex: none; }
.pf-sec .pfile-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-sec .pfile-name a { color: inherit; text-decoration: none; }
.pf-sec .pfile-name a:hover { text-decoration: underline; }
.pfile-meta { flex: none; font-size: 11px; color: #a39a85; white-space: nowrap; }
.pfile-act { flex: none; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: none; background: none; border-radius: 6px; cursor: pointer; font-size: 12px; text-decoration: none; color: inherit; opacity: .45; }
.pfile-row:hover .pfile-act { opacity: 1; }
.pfile-act:hover { background: #efe8d8; }
.pf-sec .pfile-name a, .pf-sec .pfile-name { font-weight: 400; }
.pf-sec .pfile-row.viewable .pfile-name { font-weight: 600; }
/* Загрузка в отдел, перенос, окно документа справа (15.10) */
.pf-sec-add { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px dashed #d8cdb4; background: #fff; color: #8a7a55; font-size: 16px; line-height: 1; cursor: pointer; }
.pf-sec-add:hover { border-style: solid; border-color: var(--gold); background: #FFF6DE; color: #6b4d12; }
.pf-sec.empty .pf-sec-count { background: none; color: #b8ae96; font-weight: 400; }
.pf-sec.empty .pf-sec-title { color: #8a8270; }
.pf-sec.drop-here { outline: 2px solid var(--gold); background: #FFFBF0; }
.pfile-move { width: 26px; padding: 0; appearance: none; -webkit-appearance: none; text-align: center; text-align-last: center; font-size: 13px; }
.cons-viewer-head { align-items: center; }
.cons-big-btn { margin: 0 0 0 auto; }
.cons-viewer.big { position: fixed; inset: 12px; z-index: 900; box-shadow: 0 10px 40px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.cons-viewer.big .model3d-viewer, .cons-viewer.big .pieces-view, .cons-viewer.big .model3d-empty { height: calc(100vh - 120px); }
.cons-viewer.big .doc-view { height: calc(100vh - 90px); }
.doc-view { height: min(76vh, 680px); display: flex; flex-direction: column; border-radius: 10px; background: #FAF8F2; overflow: hidden; }
.doc-view-head { display: flex; align-items: center; gap: 12px; padding: 6px 10px; font-size: 12px; border-bottom: 1px solid #ece5d6; background: #fff; }
.doc-view-head b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-view-head a { white-space: nowrap; color: #6b4d12; text-decoration: none; }
.doc-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.doc-scroll { flex: 1; overflow: auto; }
.doc-img { display: flex; justify-content: center; align-items: flex-start; padding: 10px; }
.doc-img img { max-width: 100%; }
.doc-text { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Menlo, monospace; padding: 14px; margin: 0; }
.doc-plt-info { font-size: 11px; padding: 6px 10px; }
.doc-plt { display: block; width: 100%; height: calc(100% - 30px); min-height: 400px; background: #fff; }
.doc-docx .docx-wrapper { background: #FAF8F2; padding: 12px; }
.doc-docx .docx-wrapper > section.docx { box-shadow: 0 1px 6px rgba(0,0,0,.12); margin-bottom: 12px; }
.doc-sheets { margin: 8px; flex-wrap: wrap; }
.doc-xlsx { padding: 8px; }
.doc-xlsx-wrap { position: relative; display: inline-block; background: #fff; }
.doc-xlsx table { border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.doc-xlsx td { border: 1px solid #e6e1d4; padding: 1px 3px; vertical-align: top; overflow: hidden; white-space: pre-wrap; word-break: break-word; }
.doc-xlsx-img { position: absolute; max-width: none; pointer-events: none; }
/* Вид карточек в «Производствах» (15.10) */
.prod-size-large .prod-item { flex-direction: column; align-items: stretch; padding: 8px; }
.prod-size-large .prod-item img, .prod-size-large .prod-item-nophoto { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: contain; background: #F7F5EE; }
.prod-size-large .prod-item-nophoto { display: block; }
.prod-size-medium .prod-item img, .prod-size-medium .prod-item-nophoto { width: 66px; height: 88px; }
.prod-size-list .prod-item { padding: 5px 8px; margin-bottom: 4px; }
.prod-size-list .prod-item img, .prod-size-list .prod-item-nophoto { display: none; }
.prod-size-list .prod-item-body { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
.prod-size-large .prod-item-body { align-items: flex-start; }
/* Конструктор на карточке канбана (15.10) */
.kanban-constructor-pill { background: #EFE7F6; color: #5b3b7a; border: 1px solid #d9c8ea; cursor: pointer; }
.kanban-constructor-pill:hover { border-color: #5b3b7a; }
.pill-picker .pill-check.on { background: #FFF3D6; border-color: var(--gold); font-weight: 600; }
/* Фабрики: компактные колонки слева, широкий комментарий (15.10) */
.factory-row { grid-template-columns: 190px 170px 130px 200px minmax(240px, 1fr) 84px !important; }
.factory-row.factory-editing { grid-template-columns: 190px 220px 130px 200px minmax(180px, 1fr) 170px !important; }
.factory-url-cell { display: flex; align-items: center; gap: 4px; min-width: 0; }
.factory-link { color: var(--wine, #6d0f1a); text-decoration: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.factory-link:hover { text-decoration: underline; }
.factory-url-edit { border: none; background: none; cursor: pointer; color: #a8a089; font-size: 13px; padding: 0 2px; }
.out-card { padding: 6px; }
.out-table { border-collapse: collapse; font-size: 13px; min-width: 1500px; width: 100%; }
.out-table th { text-align: left; font-size: 11.5px; font-weight: 600; color: #6b6553; padding: 6px; background: #faf7f0; border-bottom: 1px solid var(--border); position: sticky; top: 0; }
.out-table td { padding: 3px 4px; border-bottom: 1px solid #f1ece0; vertical-align: top; position: relative; }
.out-table input, .out-table textarea { width: 100%; box-sizing: border-box; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 6px; font: inherit; font-size: 13px; resize: none; }
.out-table input:hover, .out-table textarea:hover { border-color: var(--border); }
.out-table input:focus, .out-table textarea:focus { outline: none; border-color: #b59a5d; background: #fff; }
.out-table td.out-service input { font-weight: 600; }
.out-service { width: 220px; } .out-description { width: 220px; } .out-executor_name { width: 150px; } .out-phone { width: 140px; }
.out-address { width: 170px; } .out-lead_time { width: 130px; } .out-price { width: 90px; } .out-price_unit { width: 80px; } .out-comment { width: 220px; }
.out-tel { position: absolute; right: 6px; top: 8px; text-decoration: none; font-size: 12px; }
.out-act { white-space: nowrap; width: 70px; }
.out-add { display: flex; gap: 6px; } .out-add input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; font: inherit; width: 260px; }
.factory-url-input { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 13px; }
.factory-notes-input { width: 100%; min-height: 30px; resize: vertical; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 13px; line-height: 1.35; background: #fff; transition: box-shadow .3s; }
.factory-notes-input.saved-flash { box-shadow: 0 0 0 2px #8fbf8f; }
.factory-notes-view { font-size: 12px; white-space: pre-wrap; }
/* Себестоимость: компактные плашки состава (15.10, Залина: «полоска на весь экран — некрасиво») */
.cost-items { max-width: 640px; gap: 5px; }
.cost-item-row { grid-template-columns: 78px minmax(0, 1fr) 118px 28px; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 10px; background: #FCFAF5; }
.cost-item-row:hover { border-color: #d8cdb4; }
.cost-item-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.cost-item-row select { height: 28px; font-size: 12px; border-radius: 7px; }
.cost-item-qty input { width: 62px; height: 28px; font-size: 12px; border-radius: 7px; }
.cost-item-row .compare-icon-btn { width: 26px; height: 26px; }
/* Несколько скриншотов в одном поле — «Расклад цветов» (15.10) */
.multishot { display: flex; flex-direction: column; gap: 6px; }
.multishot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.compare-shot-cell .multishot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.multishot-item { position: relative; }
.multishot-item .screenshot-thumb { width: 100%; height: 110px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; max-width: none; }
.compare-shot-cell .multishot-item .screenshot-thumb { height: 80px; }
.multishot-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; }
.multishot-item:hover .multishot-del { opacity: 1; }
.multishot-add .screenshot-paste-area { min-height: 30px; padding: 6px 8px; font-size: 11px; }
.sg-export-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12px; }
.sg-export-tools select { margin-left: 4px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; }
.sg-export-tools .btn { margin: 0; }
/* Строка «кто работает» на карточке канбана: фабрика + конструктор (15.10) */
.kanban-who { display: flex; align-items: center; gap: 8px; height: 18px; font-size: 11px; line-height: 18px; color: #5f574a; min-width: 0; }
.kanban-who:empty { display: none; }
.kw-item { display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; border-radius: 4px; padding: 0 2px; }
.kw-item[data-pick-factory], .kw-item[data-pick-constructor] { cursor: pointer; }
.kw-item[data-pick-factory]:hover, .kw-item[data-pick-constructor]:hover { background: #F4EEDF; }
.kw-text { overflow: hidden; text-overflow: ellipsis; }
.kw-factory { font-weight: 600; color: #3b3428; }
.kw-constructor { color: #5b3b7a; margin-left: auto; }
.kw-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.kw-empty { color: #a39a85; font-weight: 400; }
.kw-empty:hover { color: #6b5d3e; }
.kanban-size-small .kanban-who { grid-column: 2; grid-row: 4; }
.kanban-size-small .kanban-prev-stage { grid-row: 5; }
.kanban-size-list .kanban-who { order: 1; }
/* Фабрика и конструктор друг под другом (15.10, вторая версия) */
.kanban-who-factories { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.kanban-who-factories .kanban-factory-pill { max-width: 100%; white-space: normal; height: auto; line-height: 1.35; padding: 2px 8px; cursor: pointer; overflow: visible; }
.kanban-who-constructor { font-size: 12px; line-height: 1.35; margin-top: 1px; }
.kanban-who-constructor .kw-constructor { color: #5b3b7a; font-weight: 600; cursor: pointer; border-radius: 4px; padding: 0 2px; margin-left: 0; }
.kanban-who-constructor .kw-constructor:hover { background: #F0E9F5; }
.kanban-who-factories .kw-empty, .kanban-who-constructor .kw-empty { font-size: 11px; color: #a39a85; cursor: pointer; }
.kanban-who-factories .kw-empty:hover, .kanban-who-constructor .kw-empty:hover { color: #6b5d3e; }
.kanban-size-small .kanban-who-factories { grid-column: 2; }
.kanban-size-small .kanban-who-constructor { grid-column: 2; }
.kanban-size-list .kanban-who-factories, .kanban-size-list .kanban-who-constructor { order: 1; }
.kanban-size-small .kanban-who-factories { grid-row: 4; }
.kanban-size-small .kanban-who-constructor { grid-row: 5; }
.kanban-size-small .kanban-prev-stage { grid-row: 6; }
.kanban-size-small .kanban-thumb-box { grid-row: 1 / span 5; }
.kanban-size-small .kanban-labels:empty { display: none; }
/* Канбан «Средне» (15.10): фото сверху, но ниже и колонка уже */
.kanban-size-medium .kanban-col { width: 240px; min-width: 240px; }
.kanban-size-medium .kanban-thumb-box { aspect-ratio: auto; height: 170px; }
.kanban-size-medium .kanban-card { padding: 6px 8px; }
/* Конструкторы: фильтр и группы по этапам (15.10) */
.cl-stage-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; }
.cl-stage-chip { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: #5f574a; cursor: pointer; }
.cl-stage-chip:hover { border-color: #b0a283; }
.cl-stage-chip.active { background: var(--chip-bg, #1f1b16); color: var(--chip-fg, #fff); border-color: transparent; box-shadow: 0 0 0 2px rgba(0,0,0,.18); }
.cl-stage-n { opacity: .7; font-weight: 400; margin-left: 2px; }
.cl-stage-title { display: flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; }
.cl-stage-pill { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.cl-board .prod-stage { display: none; }
/* 15.10: колонки канбана чуть шире — имя и фамилия конструктора в одну строку */
.kanban-size-small .kanban-col, .kanban-size-list .kanban-col { width: 285px; min-width: 285px; }
.kanban-size-medium .kanban-col { width: 270px; min-width: 270px; }
.kanban-who-constructor { white-space: nowrap; }
.kanban-who-constructor .kw-constructor { white-space: normal; }
/* Поставщики (15.10): отдельный столбец «Загрузка», валюты одинаковой ширины */
.suppliers-table th, .suppliers-table td { width: auto !important; }
.suppliers-table col.sc-name { width: 22%; }
.suppliers-table col.sc-load { width: 19%; }
.suppliers-table col.sc-price { width: 13%; }
.suppliers-table col.sc-cur { width: 10.5%; }
.suppliers-table col.sc-del { width: 4%; }
.suppliers-table th:nth-child(1), .suppliers-table td:nth-child(1),
.suppliers-table th:nth-child(2), .suppliers-table td:nth-child(2) { text-align: left; }
.suppliers-table th:nth-child(6), .suppliers-table td:nth-child(6) { text-align: right; }
.suppliers-table th:nth-child(8), .suppliers-table td:nth-child(8) { text-align: center; }
.suppliers-table td.supplier-load-cell .factory-load-badge { margin-left: 0; }
.suppliers-table td.supplier-name-cell { white-space: nowrap; }
.suppliers-table td.supplier-name-cell select { width: auto; max-width: 60%; }
.suppliers-table td.supplier-name-cell .supplier-best-badge { margin-left: 4px; }
.suppliers-table .supplier-price-cell input { flex: 0 1 auto; width: 70px; text-align: right; }
.suppliers-table .supplier-price-cell select { flex: 0 0 auto; width: auto; padding-right: 2px; border: none; background: transparent; color: inherit; }
.suppliers-table .supplier-price-cell select:hover, .suppliers-table .supplier-price-cell select:focus { background: var(--white); border: 1px solid var(--border); }
.sg-export-pair { display: flex; gap: 24px; align-items: flex-start; }
.sg-copy-group { display: inline-flex; align-items: center; gap: 6px; }
/* Размерная сетка: сверху две карточки — эталонная сетка и выгрузка (15.10) */
.sg-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin: 4px 0 18px; }
@media (max-width: 1250px) { .sg-top { grid-template-columns: 1fr; } }
.sg-card { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 12px 14px; min-width: 0; }
.sg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sg-card-head h4 { margin: 0; font-size: 14px; }
.sg-ref-table { font-size: 12px; }
.sg-export-tools:empty { display: none; }
.sg-export-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.sg-export-actions .btn { margin: 0; }
.sg-hint { font-size: 11px; margin: 6px 0 0; }
.sg-ref-table th, .sg-ref-table td { padding: 4px 7px !important; white-space: nowrap; font-size: 12px; }
.sg-ref-table th { font-size: 11px; }
.sg-ref-table td:first-child { white-space: normal; min-width: 90px; }
.sg-export .sg-export-table td { white-space: nowrap; }
.sg-export .sg-export-table td:first-child { white-space: normal; }
.sg-export .sg-export-table td:first-child { min-width: 125px; }
/* Размерная сетка: скрытые панели по кнопкам (15.10, третья версия) */
.sg-top { display: none; }
.sg-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.sg-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: #3b3428; cursor: pointer; }
.sg-toggle:hover { border-color: #b0a283; background: #FBF7EC; }
.sg-toggle.open { background: #1f1b16; color: #fff; border-color: #1f1b16; }
.sg-chev { display: inline-block; font-size: 15px; line-height: 1; transition: transform .15s; opacity: .7; }
.sg-toggle.open .sg-chev { transform: rotate(90deg); }
.sg-panel { border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 12px 14px; margin-bottom: 16px; }
.sg-panel-sub { font-size: 12px; margin-bottom: 8px; }
.sg-panel .sg-ref-table { width: auto; }
.sg-export .sg-export-pair { gap: 14px; }
.sg-export .sg-export-table { font-size: 11px !important; }
.sg-export .sg-export-table td { padding: 2px 5px !important; }
.sg-export .sg-export-table tr:first-child td { padding: 8px 5px !important; font-size: 13px !important; }
.sg-export .sg-export-table td:first-child { min-width: 112px; }
/* Excel «как документ» (15.10) */
.doc-xlsx { padding: 12px; }
.doc-xlsx-wrap { position: relative; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.12); }
.xl-sheet { border-collapse: collapse; table-layout: fixed; font-family: Calibri, Arial, sans-serif; font-size: 15px; color: #000; }
.xl-sheet td { padding: 0; border: 1px solid #ececec; vertical-align: top; overflow: hidden; }
.xl-sheet .xc { display: flex; flex-direction: column; padding: 1px 3px; overflow: hidden; line-height: 1.2; word-break: break-word; box-sizing: border-box; }
.xl-zoom-bar { margin: 0 0 8px; }
.doc-xlsx-img { z-index: 1; }
/* Библиотека техкарты (15.10) */
.tl-tabs { margin: 4px 0 14px; }
.tl-tab-n { opacity: .6; font-weight: 400; margin-left: 3px; }
.tl-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.tl-toolbar .mat-filter { max-width: 420px; }
.tl-stage { border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 6px; }
.tl-stage > summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; }
.tl-stage > summary::-webkit-details-marker { display: none; }
.tl-stage > summary::before { content: '›'; color: #b0a283; font-size: 16px; transition: transform .15s; }
.tl-stage[open] > summary::before { transform: rotate(90deg); }
.tl-stage-name { font-weight: 700; font-size: 13px; }
.tl-garment { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #EFE7F6; color: #5b3b7a; font-weight: 600; }
.tl-stage-zh { font-size: 12px; }
.tl-stage-n { margin-left: auto; font-size: 11px; color: #8a8270; }
.tl-stage-body { padding: 4px 12px 12px; border-top: 1px solid #efe8d8; }
.tl-stage-edit { display: grid; grid-template-columns: 1.4fr 1fr 1fr 28px; gap: 6px; padding: 8px 0; border-bottom: 1px dashed #e4dccb; margin-bottom: 4px; }
.tl-step { display: grid; grid-template-columns: minmax(0, 1fr) 200px 52px 28px; gap: 8px; align-items: start; padding: 5px 0; border-bottom: 1px solid #f3eee2; }
.tl-step-texts { display: flex; flex-direction: column; gap: 2px; }
.tl-input { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 4px 7px; font: inherit; font-size: 12.5px; background: transparent; resize: none; overflow: hidden; line-height: 1.35; transition: box-shadow .3s; }
.tl-input:hover { border-color: #e4dccb; background: #fff; }
.tl-input:focus { border-color: var(--gold); background: #fff; outline: none; }
.tl-input.zh { color: #8a8270; font-size: 12px; }
.tl-input.saved-flash { box-shadow: 0 0 0 2px #8fbf8f; }
.tl-count { font-size: 11px; color: #a39a85; text-align: right; padding-top: 6px; white-space: nowrap; }
.tl-count.new { color: #2f6b3d; }
.tl-add-step { margin-top: 8px; }
.tl-group-title { margin: 14px 0 6px; font-size: 13px; }
.tl-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 160px 52px 28px; gap: 8px; align-items: start; padding: 4px 8px; background: #fff; border: 1px solid #efe8d8; border-radius: 8px; margin-bottom: 4px; }
.tl-req { grid-template-columns: 120px minmax(0, 1.3fr) minmax(0, 1fr) 52px 28px; }
.tl-default { font-size: 11px; color: #6b5d3e; display: flex; align-items: center; gap: 4px; padding-top: 5px; }
.tl-explain { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 12.5px; line-height: 1.5; color: #4d463a; margin-bottom: 12px; }
.tl-explain p { margin: 0 0 6px; }
.tl-explain p:last-child { margin: 0; }
.tl-heads { display: grid; gap: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: #8a7a55; font-weight: 700; padding: 6px 7px 2px; }
.tl-heads .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.tl-stage-heads { grid-template-columns: 1.4fr 1fr 1fr 28px; padding-left: 7px; }
.tl-step-heads { grid-template-columns: minmax(0, 1fr) 200px 62px 28px; }
.tl-step { grid-template-columns: minmax(0, 1fr) 200px 62px 28px; }
.tl-eq-heads { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 160px 62px 28px; padding: 2px 16px; }
.tl-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 160px 62px 28px; }
.tl-req-heads { grid-template-columns: 120px minmax(0, 1.3fr) minmax(0, 1fr) 62px 28px; padding: 2px 16px; }
.tl-req { grid-template-columns: 120px minmax(0, 1.3fr) minmax(0, 1fr) 62px 28px; }
.tl-input.zh::placeholder { color: #c9c1ac; font-style: italic; }
/* Аналитика: плитки и отчёт «Где задерживаются карточки» (16.10) */
.tile-soon { opacity: .55; cursor: default; position: relative; }
.tile-soon-badge { position: absolute; top: 10px; right: 12px; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: #efe8d8; color: #8a7a55; font-weight: 700; }
.rpt-filters { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.rpt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rpt-flabel { font-size: 12px; color: #8a8270; font-weight: 600; }
.rpt-dates { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.rpt-dates input { padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12px; }
.ms { position: relative; }
.ms-btn { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 12px; cursor: pointer; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-btn.on { background: #FFF3D6; border-color: #E4C57A; color: #6b4d12; font-weight: 600; }
.ms-label { color: #8a8270; font-weight: 400; }
.ms-btn.on .ms-label { color: #8a6418; }
.ms-caret { opacity: .6; font-size: 10px; }
.ms-pop { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; min-width: 230px; max-width: 320px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 8px; }
.ms-search { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 12px; margin-bottom: 6px; }
.ms-list { max-height: 260px; overflow: auto; display: flex; flex-direction: column; }
.ms-opt { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 4px; border-radius: 6px; cursor: pointer; }
.ms-opt:hover { background: #FBF7EC; }
.ms-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; }
.ms-foot .btn { margin: 0; }
.rpt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rpt-kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.rpt-kpi b { font-size: 20px; color: #2b2620; }
.rpt-kpi span { font-size: 12px; color: #8a8270; }
.rpt-kpi.warn b { color: #b23a2e; }
.rpt-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; min-width: 0; }
.rpt-card h3 { margin: 0 0 8px; font-size: 15px; }
.rpt-card h3 .muted { font-weight: 400; font-size: 12px; }
.rpt-sub { font-size: 11.5px; margin: -4px 0 8px; }
.rpt-legend { display: flex; gap: 16px; font-size: 11px; color: #8a8270; margin-bottom: 8px; }
.rpt-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 4px; vertical-align: middle; margin-right: 5px; }
.lg-done { background: #9F8151; } .lg-open { background: #E9B7A9; }
.rpt-bar-row { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; gap: 12px; align-items: center; padding: 5px 6px; border-radius: 8px; cursor: pointer; }
.rpt-bar-row:hover { background: #FBF7EC; }
.rpt-bars { display: flex; flex-direction: column; gap: 3px; }
.rpt-bar { height: 10px; border-radius: 5px; min-width: 2px; }
.rpt-bar.done { background: #9F8151; }
.rpt-bar.open { background: #E9B7A9; height: 6px; }
.rpt-bar-nums { font-size: 12px; }
.rpt-bar-nums .muted { font-size: 11px; }
.rpt-stage-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.rpt-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 1250px) { .rpt-grid2 { grid-template-columns: 1fr; } .rpt-bar-row { grid-template-columns: 150px minmax(0, 1fr) 210px; } }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rpt-table th { text-align: left; font-size: 11px; color: #8a7a55; font-weight: 700; padding: 5px 6px; border-bottom: 1px solid #efe8d8; white-space: nowrap; }
.rpt-table td { padding: 5px 6px; border-bottom: 1px solid #f3eee2; vertical-align: middle; }
.rpt-heat td { text-align: center; }
.rpt-heat td:first-child { text-align: left; }
.rpt-table td:nth-child(3), .rpt-table td:nth-child(4) { white-space: nowrap; }
/* Фильтры отчётов — в стиле «Товаров» (16.10) */
.filter-pills .ms-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 30px 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); font-size: 13px; position: relative; max-width: 300px; color: var(--ink); font-weight: 400; }
.filter-pills .ms-btn::after { content: ''; position: absolute; right: 13px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: .55; }
.filter-pills .ms-btn:hover { border-color: #bfb49a; }
.filter-pills .ms-btn .ms-label { color: #8a826e; }
.filter-pills .ms-btn .ms-caret { display: none; }
.filter-pills .ms-btn.on { background: var(--ink); border-color: var(--ink); color: var(--white); font-weight: 600; }
.filter-pills .ms-btn.on .ms-label { color: #cfc8b6; font-weight: 400; }
.filter-pills .ms-btn { font-weight: 600; }
.period-pop { min-width: 300px; }
.period-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.period-presets .btn { margin: 0; }
.period-dates { display: flex; gap: 10px; font-size: 12px; }
.period-dates input { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 12px; }
/* Отчёт «Решения аналитики» */
.an-note { font-size: 12px; margin: -6px 0 10px; }
.an-risks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.an-risk { border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12px; cursor: pointer; border: 1px solid; }
.an-risk.red { background: #fbeceb; border-color: #e7b5b0; color: #962f25; }
.an-risk.yellow { background: #fbf3e2; border-color: #e8cf97; color: #8a6418; }
.an-risk.grey { background: #f3f1ec; border-color: #dcd6c8; color: #6b6352; }
.an-risk.on { box-shadow: 0 0 0 2px var(--ink); }
.rpt-kpi b small { font-size: 12px; color: #8a8270; font-weight: 600; }
.c-yes { color: #2f6b3d !important; } .c-dispute { color: #8a6418 !important; } .c-no { color: #962f25 !important; }
.an-table-card { padding: 6px; }
.an-table { font-size: 12px; }
.an-table th { background: #FAF7F0; position: sticky; top: 0; z-index: 1; }
.an-table th.an-country { text-align: center; border-left: 1px solid #efe8d8; }
.an-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.an-table td small { display: block; font-size: 10.5px; }
.an-table td.num small { display: inline; }
.an-model { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.an-model img, .an-nophoto { width: 34px; height: 46px; object-fit: cover; border-radius: 4px; background: #F7F5EE; flex: none; }
.an-model a { font-weight: 700; color: inherit; }
.an-chain { white-space: nowrap; }
.an-v { display: inline-flex; flex-direction: column; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; line-height: 1.2; cursor: help; }
.an-v small { font-weight: 400; font-size: 10px; opacity: .8; }
.an-v.verdict-yes { background: #e6f2e6; color: #2f6b3d; } .an-v.verdict-dispute { background: #fbf3e2; color: #8a6418; } .an-v.verdict-no { background: #fbeceb; color: #962f25; } .an-v.verdict-neutral { background: #f1ede3; color: #6b6352; }
.an-arrow { color: #b0a283; margin: 0 3px; }
.an-none { font-size: 11px; }
.an-now.archived { font-size: 11px; color: #8a8270; background: #efe9dc; border-radius: 999px; padding: 2px 8px; }
.cell-red { background: #fbeceb; color: #962f25; font-weight: 700; }
.cell-yellow { background: #fbf3e2; color: #8a6418; font-weight: 700; }
.an-complete { white-space: nowrap; color: #2f6b3d; font-size: 12px; }
.an-complete span { color: #b23a2e; }
/* «Решения аналитики» — спокойнее (16.10, вторая версия) */
.an-model { min-width: 0; max-width: 150px; gap: 6px; }
.an-model a { font-size: 12.5px; }
.an-model small { font-size: 10.5px; color: #8a8270; }
.an-model img, .an-nophoto { width: 28px; height: 38px; }
.an-chain-btn { display: inline-flex; align-items: center; border: none; background: none; padding: 2px; border-radius: 8px; cursor: pointer; font: inherit; }
.an-chain-btn:hover { background: #FBF7EC; }
.an-v { cursor: pointer; }
.an-now { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #5f574a; white-space: nowrap; }
.an-now i { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.an-now-archived { border: none; background: #efe9dc; color: #6b6352; font: inherit; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; cursor: pointer; text-align: left; max-width: 190px; }
.an-now-archived:hover { background: #e4dccb; }
.an-table th.an-country { text-align: center; vertical-align: bottom; }
.an-table th small { display: block; font-weight: 400; font-size: 10px; color: #a39a85; text-transform: none; }
.an-table td.an-cc { text-align: center; border-left: 1px solid #f3eee2; white-space: nowrap; }
.an-table td.an-cc small { display: block; font-size: 10.5px; color: #8a8270; margin-top: 1px; }
.an-margin { display: inline-block; font-weight: 700; font-size: 12.5px; padding: 1px 8px; border-radius: 999px; }
.an-margin.ok { background: #e6f2e6; color: #2f6b3d; } .an-margin.yellow { background: #fbf3e2; color: #8a6418; } .an-margin.red { background: #fbeceb; color: #962f25; }
.an-link { border: none; background: none; font: inherit; font-weight: 700; font-size: 12.5px; color: #3b3428; cursor: pointer; padding: 1px 6px; border-radius: 6px; text-decoration: underline dotted #b0a283; text-underline-offset: 3px; }
.an-link:hover { background: #FBF7EC; }
.an-link.warn { color: #8a6418; background: #fbf3e2; }
.an-fill { border: none; background: none; font: inherit; cursor: pointer; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 2px 4px; border-radius: 6px; }
.an-fill:hover { background: #FBF7EC; }
.an-fill span { font-size: 10.5px; white-space: nowrap; }
.an-fill .ok { color: #2f6b3d; } .an-fill .no { color: #b23a2e; }
.an-pop { position: absolute; z-index: 1000; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 12px 14px; max-width: 380px; min-width: 240px; font-size: 12.5px; max-height: 70vh; overflow: auto; }
.an-pop h4 { margin: 0 24px 8px 0; font-size: 13px; }
.an-pop p { margin: 4px 0; }
.an-pop-x { position: absolute; top: 6px; right: 8px; border: none; background: none; font-size: 18px; cursor: pointer; color: #8a8270; }
.pop-step { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid #f3eee2; }
.pop-step:first-of-type { border-top: none; }
.pop-comment { color: #4d463a; margin-top: 2px; white-space: pre-wrap; }
.pop-formula { background: #FBF7EC; border-radius: 8px; padding: 6px 8px; }
.pop-comps { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.pop-comp { display: flex; gap: 8px; align-items: flex-start; }
.pop-comp img, .pop-comp .an-nophoto { width: 38px; height: 50px; object-fit: cover; border-radius: 4px; flex: none; }
/* «Решения аналитики», третья версия (16.10) */
.an-cell2 { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; min-width: 0; max-width: 200px; border: none; background: none; font: inherit; padding: 3px 6px; border-radius: 8px; }
.an-click { cursor: pointer; }
.an-click:hover { background: #FBF7EC; }
.an-cell2 .an-main { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #2b2620; }
.an-cell2 small { font-size: 11px; color: #8a8270; line-height: 1.3; white-space: normal; }
.an-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.an-dot.verdict-yes { background: #3a7a4a; } .an-dot.verdict-dispute { background: #c9932c; } .an-dot.verdict-no { background: #b23a2e; } .an-dot.verdict-neutral { background: #b0a283; }
.an-dot.archived { background: #b0a283; }
.an-table td.an-kv { border-left: 1px solid #f3eee2; font-size: 11.5px; white-space: nowrap; min-width: 128px; }
.an-kv > div, .an-kv-inline { display: flex; justify-content: space-between; gap: 10px; line-height: 1.55; }
.an-kv span, .an-kv-inline span { color: #a39a85; }
.an-kv b, .an-kv-inline b { font-weight: 600; color: #2b2620; font-variant-numeric: tabular-nums; }
.an-m.red { color: #962f25; } .an-m.yellow { color: #8a6418; } .an-m.ok { color: #2f6b3d; }
.an-kv.an-bad { background: #fff6f4; }
.an-bad-note { color: #962f25; font-weight: 600; justify-content: flex-start !important; }
.an-table td.an-cc .an-kv-inline { font-size: 11.5px; min-width: 90px; }
.pop-grid { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin-top: 3px; }
.pop-grid span { color: #8a8270; }
.pop-period { font-size: 11px; margin-top: 2px; }
.pop-complaints { font-size: 11.5px; margin-top: 4px; background: #FBF7EC; border-radius: 6px; padding: 4px 6px; color: #4d463a; }
.an-pop { max-width: 420px; }
.an-table td, .an-table th { padding: 5px 5px; }
.an-table td.an-kv { min-width: 112px; }
.an-cell2 { max-width: 170px; }
.an-fill span { font-size: 10.5px; }
/* Галерея ткани (16.10) */
.fabric-gallery { margin-bottom: 12px; }
.fg-main { width: 100%; height: 300px; border-radius: 10px; background: #F7F5EE; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.fg-main img, .fg-main video { max-width: 100%; max-height: 300px; object-fit: contain; display: block; }
.fg-main a { display: contents; }
.fg-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fg-thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; background: #F7F5EE; }
.fg-thumb.on { border-color: var(--gold); }
.fg-thumb img, .fg-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fg-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; text-shadow: 0 1px 4px rgba(0,0,0,.6); pointer-events: none; }
.fg-cover { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(31,27,22,.75); color: #fff; font-size: 9px; text-align: center; padding: 1px 0; }
.fg-act { position: absolute; top: 2px; width: 18px; height: 18px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); font-size: 11px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s; padding: 0; }
.fg-act[data-fg-cover] { left: 2px; color: #b8860b; }
.fg-del { right: 2px; color: #962f25; }
.fg-thumb:hover .fg-act { opacity: 1; }
.fg-add { width: 64px; height: 64px; border-radius: 8px; border: 1px dashed #c9c1ac; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: 20px; color: #8a7a55; background: #fff; }
.fg-add small { font-size: 9px; }
.fg-add:hover { border-color: var(--gold); background: #FFF6DE; }
.fg-hint { font-size: 11px; margin-top: 4px; }
.mat-thumb-wrap { position: relative; display: inline-flex; flex: none; }
.mat-more { position: absolute; right: -4px; bottom: -4px; background: var(--ink); color: #fff; font-size: 9px; font-weight: 700; border-radius: 999px; padding: 1px 5px; }
.an-warn-link { font-size: 11px; color: #8a6418; background: #fbf3e2; border-radius: 999px; padding: 2px 8px; text-decoration: none; white-space: nowrap; }
.an-cc .an-main { flex-wrap: wrap; justify-content: center; }
/* Артикулы WB по цветам (16.10) */
.wb-rows { display: flex; flex-direction: column; gap: 5px; }
.wb-row { display: grid; grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1.3fr) 18px 24px; gap: 6px; align-items: center; }
.wb-row select, .wb-row input { width: 100%; }
.wb-row a { text-decoration: none; color: #8a6418; }
.wb-add { align-self: flex-start; margin: 2px 0 0 !important; }
.an-wb { display: block; font-size: 12px; font-weight: 600; }
.an-wb small { font-weight: 400; color: #8a8270; }
/* Материалы и цены: комментарий к цене по стране (19.10) */
.mat-note-head { font-size: 11px; color: #8a7a55; }
.mat-note-cell { vertical-align: top; min-width: 130px; max-width: 200px; }
.mat-note-btn { width: 100%; border: 1px dashed transparent; background: none; font: inherit; text-align: left; padding: 4px 6px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.mat-note-btn:hover { border-color: #d8cdb4; background: #FBF7EC; }
.mat-note-btn.has { background: #FFFBF0; border-color: #efe3c4; }
.mat-note-text { font-size: 11.5px; color: #4d463a; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.mat-note-photos { display: flex; gap: 3px; align-items: center; }
.mat-note-photos img { width: 30px; height: 30px; object-fit: cover; border-radius: 4px; }
.mat-note-photos span { font-size: 10px; color: #8a8270; }
.mat-note-add { font-size: 11px; color: #b0a283; }
.nwp-photos { margin-top: 2px; }
/* Ткани с рынков (19.10) */
.mf-city { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13px; cursor: pointer; }
.mf-city span { color: #a39a85; font-size: 11px; margin-left: 2px; }
.mf-city.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.mf-city.on span { color: #cfc8b6; }
.mf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mf-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: #fff; overflow: hidden; padding: 0; text-align: left; font: inherit; cursor: pointer; }
.mf-card:hover { border-color: var(--gold); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.mf-photo { position: relative; aspect-ratio: 4 / 3; background: #F7F5EE; display: flex; align-items: center; justify-content: center; }
.mf-photo img { width: 100%; height: 100%; object-fit: cover; }
.mf-nophoto { color: #b0a283; font-size: 12px; }
.mf-more { position: absolute; right: 8px; bottom: 8px; background: rgba(31,27,22,.75); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.mf-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 12px; font-size: 12.5px; }
.mf-body b { font-size: 13.5px; }
.mf-chip { align-self: flex-start; font-size: 11px; background: #F4EEDF; color: #6b5d3e; padding: 1px 8px; border-radius: 999px; }
.mf-line { color: #4d463a; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mf-comment { color: #6f6754; font-size: 12px; background: #FBF7EC; border-radius: 6px; padding: 4px 6px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mf-meta { font-size: 10.5px; color: #a39a85; margin-top: 2px; }
.field-row label.fg-add { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; font-weight: 400; font-size: 20px; }
/* Материалы и цены: страна — отдельный блок (19.10) */
th.cb-head { text-align: center !important; font-size: 13.5px; font-weight: 700; color: #3b3428; letter-spacing: .02em; border-bottom: 1px solid #e4dccb; }
th.cb-sub { font-size: 11px; font-weight: 600; color: #8a7a55; text-transform: uppercase; letter-spacing: .03em; }
.cb-start, td.mat-actions-cell { border-left: 3px solid #d6c9a6 !important; }
.cb-0 { background-color: rgba(250, 246, 236, .9) !important; }
.cb-1 { background-color: rgba(236, 243, 249, .9) !important; }
th.cb-0 { background-color: #F4EDDC !important; }
th.cb-1 { background-color: #E3EDF6 !important; }
/* Библиотека тканей: виды и видео (19.10) */
.mf-grid.small { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.mf-grid.small .mf-body { padding: 7px 9px 9px; font-size: 11.5px; gap: 3px; }
.mf-grid.small .mf-body b { font-size: 12.5px; }
.mf-grid.small .mf-comment { -webkit-line-clamp: 2; font-size: 11px; }
.mf-grid.small .mf-cph { display: none; }
.mf-k { color: #a39a85; font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; margin-right: 3px; }
.mf-cph { display: flex; gap: 3px; align-items: center; }
.mf-cph img, .mf-cph .mf-vid { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.mf-cph > span:not(.mf-vid) { font-size: 10px; color: #8a8270; }
.mf-vid { position: relative; display: inline-block; overflow: hidden; background: #1f1b16; }
.mf-vid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mf-photo .mf-vid { width: 100%; height: 100%; }
.mf-table td { vertical-align: top; }
.mf-row { cursor: pointer; }
.mf-row:hover td { background: #FBF7EC; }
.mf-tmedia { white-space: nowrap; }
.mf-tmedia img, .mf-tmedia .mf-vid { width: 44px; height: 44px; object-fit: cover; border-radius: 5px; margin-right: 3px; vertical-align: middle; }
.mf-tmore { font-size: 11px; color: #8a8270; }
.mf-tpre { white-space: pre-wrap; max-width: 240px; }
.mf-tcomment { max-width: 300px; color: #4d463a; }
/* 19.10: галочки и переключатели внутри форм не растягиваются на всю ширину. Общее
   правило «.field-row input { width: 100% }» в Safari растягивало галочку в плашках
   «Коллекции» / «Фабрики» на всю плашку, и название выдавливалось. */
.field-row input[type="checkbox"], .field-row input[type="radio"],
.pill-picker .pill-check input { width: auto !important; padding: 0 !important; margin: 0 !important; flex: none; border: none; background: none; box-shadow: none; }
.pill-picker .pill-check { white-space: nowrap; }
.mat-country-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; font-size: 13px; }
.mat-country-cell select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12.5px; background: #fff; min-width: 120px; }
.mat-nocountry { font-size: 12px; font-style: italic; }
/* Страна в «Материалах и ценах» — плашкой (19.10) */
.mat-country-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 26px 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.mat-country-pill::after { content: ''; position: absolute; right: 10px; top: 50%; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-70%) rotate(45deg); opacity: .5; }
.mat-country-pill select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.mat-country-pill.cc-0 { background: #F4EDDC; color: #6b4d12; }
.mat-country-pill.cc-1 { background: #E3EDF6; color: #2c4f73; }
.mat-country-pill.cc-2 { background: #E6F2E6; color: #2f6b3d; }
.mat-country-pill.cc-3 { background: #F0E9F5; color: #5b3b7a; }
.mat-country-pill.empty { background: none; border: 1px dashed #c9c1ac; color: #a39a85; font-weight: 400; }
.mat-country-cell { vertical-align: middle; }
.mat-country-pill.cc-tz { background: #EFE7F6; color: #5b3b7a; }
.mat-tz-suggest { margin: 0 0 0 6px !important; }
/* Экономика WB (20.10) */
.ue-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; margin-bottom: 14px; }
.ue-group { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.ue-group h4 { margin: 0 0 8px; font-size: 13px; }
.ue-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid #f3eee2; cursor: text; }
.ue-row:first-of-type { border-top: none; }
.ue-label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: #3b3428; }
.ue-label small { font-weight: 400; font-size: 11px; color: #8a8270; }
.ue-input { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ue-input input { width: 90px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; text-align: right; }
.ue-input span { color: #8a8270; font-size: 12px; width: 14px; }
.ue-example { background: #FBF7EC; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-top: 14px; }
.ue-example h4 { margin: 0 0 6px; }
.ue-example ul { margin: 4px 0 0; padding-left: 18px; }
/* Решение + судьба модели в одной ячейке */
.an-dec { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; border: none; background: none; font: inherit; text-align: left; padding: 3px 6px; border-radius: 8px; max-width: 210px; }
.an-dec-main { font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.an-dec-main small { font-weight: 400; font-size: 10.5px; color: #a39a85; }
.an-dec-main.verdict-yes { color: #2f6b3d; } .an-dec-main.verdict-dispute { color: #8a6418; } .an-dec-main.verdict-no { color: #962f25; }
.an-dec-n { font-size: 10.5px; font-weight: 600; color: #6b6352; background: #f1ede3; border-radius: 999px; padding: 0 6px; }
.an-fate { font-size: 11px; color: #8a8270; line-height: 1.3; }
.an-fate.ok { color: #2f6b3d; }
.an-fate.archived { color: #962f25; }
.an-rec { border-top: 1px dashed #e4dccb; margin-top: 2px; padding-top: 2px; }
.an-rec b { color: #6b4d12; }

/* ---------- Юнит-экономика (20.10) ---------- */
.ue-table td { vertical-align: middle; }
.ue-table td.num small { display: block; color: var(--muted, #8a8172); font-size: 10.5px; }
.ue-table tr.ue-bad td { background: #fff6f3; }
.ue-warn { color: #b4471f !important; }
.ue-input-wrap { display: inline-flex; align-items: center; gap: 2px; }
.ue-input { width: 76px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font: inherit; text-align: right; background: #fffdf8; }
.ue-input:focus { outline: 2px solid #e8d9b5; background: #fff; }
.ue-cur { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 3px 6px; cursor: pointer; font-size: 12px; }
.ue-in small { display: block; font-size: 10.5px; color: #8a8172; }
.ue-drift { color: #b4471f !important; }
.ue-over { color: #b4471f; font-weight: 600; }
.ue-fix { white-space: nowrap; }
.ue-fix-btn { border: 1px dashed #cdbf9f; background: #fff; border-radius: 999px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; color: #6b6253; }
.ue-fix-btn.on { border-style: solid; background: #f5efe0; color: #4a4232; }
.ue-hist-btn { border: none; background: none; cursor: pointer; font-size: 13px; padding: 2px 4px; }
.ue-ov-n { font-size: 10.5px; background: #efe5cf; border-radius: 6px; padding: 0 4px; }
.ue-params h4 { margin: 14px 0 6px; font-size: 13px; }
.ue-params-head { margin-bottom: 8px; }
.ue-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.ue-pf { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; }
.ue-pf-in { display: inline-flex; align-items: center; gap: 4px; }
.ue-pf-in i { font-style: normal; color: #8a8172; width: 12px; }
.ue-p { width: 64px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; text-align: right; font: inherit; }
.ue-cc { margin-top: 6px; font-size: 12.5px; }
.ue-cc summary { cursor: pointer; }
.ue-cc .ue-pgrid { margin-top: 6px; }
.ue-params-save { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.ue-rate { margin-top: 10px; font-size: 12.5px; }
.ue-vers { margin-top: 8px; font-size: 12px; }
.ue-vers summary { cursor: pointer; }
.ue-vers table { margin-top: 6px; }
.ue-calc-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 8px 0; font-size: 13px; }
.ue-calc-row input { width: 80px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; }
.ue-calc-row select { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.ue-calc-res { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.ue-asof { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.ue-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.ue-cat { display: flex; flex-direction: column; gap: 3px; min-width: 130px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font-size: 12px; }
.ue-cat.on { border-color: #b59a5d; background: #faf4e6; }
.ue-cat-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; background: #eee; }
.ue-cat-bar i.ok { background: #4c9a5b; } .ue-cat-bar i.yellow { background: #e0b43c; } .ue-cat-bar i.red { background: #d0573a; }
.ue-bulk { margin: 0 0 8px; }
.ue-ov-grid { display: grid; grid-template-columns: 1fr; gap: 5px; min-width: 330px; }
.ue-ov-grid label { display: grid; grid-template-columns: 1fr 64px 14px 110px; gap: 6px; align-items: center; font-size: 12.5px; }
.ue-ov-grid input { padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; text-align: right; width: 64px; }
.ue-ov-grid i { font-style: normal; color: #8a8172; }
.ue-ov-grid small { font-size: 10.5px; }
.ue-hist { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; font-size: 12.5px; min-width: 280px; }
.kpi-value-input.kpi-auto { background: #f5f1e8; color: #4a4232; cursor: default; }
@media (max-width: 700px) { .ue-pgrid { grid-template-columns: 1fr; } .ue-ov-grid { min-width: 0; } .ue-ov-grid label { grid-template-columns: 1fr 60px 12px; } .ue-ov-grid small { display: none; } }

/* ---------- История действий в карточке (20.10) ---------- */
.hist-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.hist-table { display: flex; flex-direction: column; }
.hist-day { font-weight: 600; font-size: 12.5px; color: #6b6253; padding: 10px 0 4px; border-bottom: 1px solid var(--border); }
.hist-row { display: grid; grid-template-columns: 46px 150px 140px 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f1ece0; font-size: 13px; align-items: baseline; }
.hist-time { color: #8a8172; font-variant-numeric: tabular-nums; font-size: 12px; }
.hist-who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-sec { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #f2ede2; color: #5c5444; justify-self: start; white-space: nowrap; }
.hist-sec-Юнит-экономика, .hist-sec-Цены { background: #e7f2e4; color: #2f6a3a; }
.hist-sec-Этапы { background: #e9eef8; color: #34508a; }
.hist-sec-Данные { background: #fbefdc; color: #8a5a17; }
.hist-old { color: #8a8172; text-decoration: line-through; }
.hist-n { font-size: 11px; background: #efe5cf; border-radius: 6px; padding: 0 5px; }
@media (max-width: 700px) { .hist-row { grid-template-columns: 40px 1fr; } .hist-sec { grid-column: 2; } .hist-what { grid-column: 1 / -1; } }
.ue-country { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f3ead2; color: #7a5b16; white-space: nowrap; }
.ue-country.ue-cc-1 { background: #e3eef9; color: #2c5a8c; }
.ue-country.ue-cc-2 { background: #e7f2e4; color: #2f6a3a; }
.ue-country.ue-cc-3 { background: #f6e4ec; color: #8a2f57; }
/* юнит-экономика: параметры карточками (20.10, вторая версия) */
.ue-params-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.ue-params-head b { font-size: 15px; }
.ue-sec { margin-top: 14px; }
.ue-sec-t { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.ue-sec-t .muted { font-weight: 400; }
.ue-pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.ue-pcards-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 8px; }
.ue-pc { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fffdf8; cursor: text; }
.ue-pc:focus-within { border-color: #b59a5d; background: #fff; }
.ue-pc-l { font-size: 12.5px; font-weight: 600; color: #3d362a; line-height: 1.25; }
.ue-pc-in { display: flex; align-items: center; gap: 6px; }
.ue-pc-in .ue-p { width: 100%; max-width: 90px; font-size: 15px; font-weight: 600; padding: 4px 8px; text-align: left; }
.ue-pc-in i { font-style: normal; color: #8a8172; font-size: 13px; }
.ue-pc-n { font-size: 11px; color: #8a8172; line-height: 1.25; }
.ue-pc-sm { padding: 6px 8px; }
.ue-pc-sm .ue-pc-l { font-weight: 500; font-size: 12px; }
.ue-pc-sm .ue-p { font-size: 13px; font-weight: 500; max-width: 70px; }
.ue-pc .ue-p::placeholder { color: #b9b09e; font-weight: 400; }
.ue-params-save { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 12px; }
.ue-vf { font-size: 13px; color: #5c5444; }
.ue-vf-btn { border: none; background: none; color: #6d0f1a; font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline dotted; }
.ue-vf input[type=date] { margin-left: 6px; }
.ue-save-note { margin: 6px 0 0; font-size: 12px; }
.ue-tool { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 13.5px; cursor: pointer; color: #3d362a; }
.ue-tool:hover { border-color: #b59a5d; }
.ue-tool.on { background: #f5efe0; border-color: #b59a5d; font-weight: 600; }
.ue-cats-h { font-size: 12px; margin: 0 0 6px; }
.ue-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: -1px; }
.ue-dot.ok { background: #4c9a5b; } .ue-dot.yellow { background: #e0b43c; } .ue-dot.red { background: #d0573a; }
.ue-cat-cnt { display: flex; gap: 4px; }
.ue-cat-cnt i { font-style: normal; font-size: 11px; font-weight: 600; min-width: 22px; text-align: center; border-radius: 6px; padding: 1px 5px; }
.ue-cat-cnt i.ok { background: #e3f1e5; color: #2f6a3a; } .ue-cat-cnt i.yellow { background: #faf0d2; color: #7d5d0c; } .ue-cat-cnt i.red { background: #fae3dd; color: #9a3a22; }
.ue-calc { margin-bottom: 12px; }
[data-asof-pill] { position: relative; } [data-asof-pill] .ms-pop { right: 0; left: auto; }
/* ручные поля юнит-экономики — жёлтые, как «заполнять» в таблице закупок */
.ue-table th.ue-manual-h { background: #fff1b8 !important; color: #5c4700; }
.ue-table td.ue-manual { background: #fff8d9; }
.ue-table tr.ue-bad td.ue-manual { background: #fff1c9; }
.ue-table td.ue-manual .ue-input { background: #fff; border-color: #e6cf73; }
.ue-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin: 0 0 8px; color: #5c5444; }
.ue-legend-box { width: 14px; height: 14px; border-radius: 3px; background: #fff1b8; border: 1px solid #e6cf73; }
/* карточка → Аналитика: цифры юнит-экономики под плашками страны (20.10) */
.kpi-econ { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: flex-end; margin-top: 8px; padding: 8px 12px; border: 1px dashed #d9cdb0; border-radius: 10px; background: #fffdf8; font-size: 12.5px; }
.kpi-econ-i { display: flex; flex-direction: column; gap: 1px; }
.kpi-econ-i span { color: #8a8172; font-size: 11.5px; }
.kpi-econ-i b { font-size: 14px; }
.kpi-econ-i small { color: #8a8172; font-size: 10.5px; }
.kpi-econ-i.hl b { color: #2f6a3a; }
.kpi-econ-link { margin-left: auto; font-size: 12px; color: #6d0f1a; }
.kpi-econ-warn { font-size: 11.5px; color: #9a3a22; }
.kpi-econ-link { border: none; background: none; cursor: pointer; font: inherit; font-size: 12px; color: #6d0f1a; text-decoration: underline dotted; padding: 0; }
.econ-steps { margin-top: 6px; padding: 10px 12px; border: 1px solid #e6dcc4; border-radius: 10px; background: #fff; font-size: 12.5px; }
.econ-steps-h { font-weight: 600; margin: 10px 0 4px; color: #3d362a; }
.econ-steps-h:first-child { margin-top: 0; }
.econ-step { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; padding: 3px 0; border-bottom: 1px dotted #eee5d2; align-items: baseline; }
.econ-step-l { color: #3d362a; }
.econ-step-f { color: #8a8172; font-size: 11.5px; }
.econ-step-f small { font-size: 10.5px; background: #f3eee3; border-radius: 6px; padding: 0 5px; margin-left: 3px; }
.econ-step b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.econ-step.sum { border-bottom: 1px solid #d9cdb0; }
.econ-step.sum .econ-step-l, .econ-step.sum b { font-weight: 700; }
.econ-steps-note { margin: 8px 0 0; font-size: 11.5px; }
@media (max-width: 700px) { .econ-step { grid-template-columns: 1fr auto; } .econ-step-f { grid-column: 1 / -1; grid-row: 2; } }
.kpi-cell.kpi-saving { opacity: .6; }
.kpi-cell.kpi-saved { box-shadow: 0 0 0 2px #7fbf8a; transition: box-shadow .3s; }
/* цена «авто» / «своя» (20.10) */
.kpi-price-mode { font-size: 10.5px; margin-top: 3px; color: #2f6a3a; }
.kpi-price-mode.own { color: #7d5d0c; }
.kpi-price-mode button, .ue-mini { border: none; background: none; padding: 0; font: inherit; color: #6d0f1a; cursor: pointer; text-decoration: underline dotted; }
.ue-mode { display: block; font-size: 10.5px; color: #2f6a3a; margin-top: 2px; }
.ue-mode.own { color: #7d5d0c; }
.ue-input.ue-auto { color: #2f6a3a; }
.econ-backup { margin-top: 10px; padding: 8px 10px; background: #f8f4ea; border-radius: 8px; font-size: 12.5px; }
.kpi-econ-bad { border-color: #e5a28f; background: #fff6f3; }

/* ---------- Отзывы покупателей WB (21.10) ---------- */
.fb-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 12.5px; }
.fb-star-off { color: #e3dccb; }
.fb-stars { color: #e0a520; letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.fb-stars.s1, .fb-stars.s2 { color: #d0573a; } .fb-stars.s3 { color: #e08a2c; }
.fb-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.fb-sum-col { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.fb-sum-t { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.fb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-chip { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.fb-chip.neg { background: #fae3dd; color: #8a2f1b; } .fb-chip.pos { background: #e3f1e5; color: #2f6a3a; }
.fb-note { font-size: 11.5px; margin: 4px 0 10px; }
.fb-group { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.fb-group > summary { cursor: pointer; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; font-size: 13px; }
.fb-group > summary::-webkit-details-marker { display: none; }
.fb-group > summary::before { content: '▸'; color: #8a8172; }
.fb-group[open] > summary::before { content: '▾'; }
.fb-g-themes { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 6px; }
.fb-ai { margin: 0 12px 10px; padding: 8px 10px; background: #f8f4ea; border-radius: 8px; font-size: 13px; line-height: 1.4; }
.fb-ai-l { font-weight: 600; }
.fb-list { padding: 0 12px 6px; max-height: 620px; overflow: auto; }
.fb-item { border-top: 1px solid #f1ece0; padding: 9px 0; font-size: 13px; }
.fb-item-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; margin-bottom: 3px; }
.fb-meta { background: #f3eee3; border-radius: 6px; padding: 0 6px; }
.fb-art { font-size: 11px; }
.fb-text { white-space: pre-wrap; line-height: 1.4; }
.fb-pc { margin-top: 3px; line-height: 1.4; }
.fb-bables { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fb-bables span { font-size: 11px; background: #eef1f6; color: #3b4b66; border-radius: 6px; padding: 1px 6px; }
.fb-photos { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.fb-photos img { width: 64px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.fb-rpt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fb-model { display: inline-flex; gap: 8px; align-items: center; }
.fb-model img, .fb-model .an-nophoto { width: 34px; height: 44px; object-fit: cover; border-radius: 5px; flex: none; }
.fb-model > span { display: flex; flex-direction: column; }
.fb-model small { font-size: 11px; color: #8a8172; }
.fb-nocrm { font-size: 10px; background: #f3eee3; color: #8a8172; border-radius: 6px; padding: 0 5px; }
.fb-top-themes { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.fb-rec { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.fb-rec-i { border: 1px solid #f1ece0; border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.fb-rec-i ul { margin: 6px 0 0; padding-left: 18px; }
.fb-rec-i li { margin: 2px 0; }
.fb-rec-n { font-size: 11.5px; display: block; margin-top: 2px; }
.fb-streak { font-size: 11px; background: #e9eef8; color: #34508a; border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.fb-resolved { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.fb-dist { min-width: 180px; }
.fb-dist > div { display: grid; grid-template-columns: 22px 1fr 34px; gap: 6px; align-items: center; font-size: 11px; }
.fb-dist i { display: block; height: 6px; border-radius: 3px; background: #e0a520; min-width: 2px; }
.fb-dist i.s1, .fb-dist i.s2 { background: #d0573a; } .fb-dist i.s3 { background: #e08a2c; }
.fb-dist b { font-size: 11px; text-align: right; }
@media (max-width: 800px) { .fb-sum, .fb-rpt-grid { grid-template-columns: 1fr; } }
.fb-model > span { align-items: flex-start; }
.fb-loading { background: #fff6dc; border: 1px solid #f0dc9a; color: #6b5310; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin: 0 0 12px; }
/* отзывы v2 — компактнее (21.10) */
.fb-colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; font-size: 12.5px; }
.fb-cbtn { position: relative; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; }
.fb-cbtn small { color: #8a8172; margin-left: 2px; }
.fb-cbtn.on { background: #3d362a; color: #fff; border-color: #3d362a; }
.fb-cbtn.on small { color: #d9d0bd; }
.fb-neg-dot { position: absolute; top: -6px; right: -4px; font-style: normal; font-size: 10px; background: #d0573a; color: #fff; border-radius: 999px; padding: 0 5px; line-height: 15px; }
.fb-kpis { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 12px; }
.fb-kpis > div { display: flex; flex-direction: column; }
.fb-kpis b { font-size: 20px; }
.fb-kpis span { font-size: 12px; color: #8a8172; }
.fb-color-tag { background: #f3eee3; border-radius: 6px; padding: 0 7px; font-size: 12px; color: #4a4232; }
.fb-fit { font-size: 11.5px; color: #9a3a22; }
.fb-date { margin-left: auto; }
.fb-item { padding: 10px 0; }
.fb-text { font-size: 13.5px; }
.fb-pc { font-size: 13px; margin-top: 4px; }
.fb-pc.plus { color: #2f6a3a; } .fb-pc.minus { color: #9a3a22; }
.fb-notext { font-size: 12px; margin: 8px 0 4px; }
.fb-group > summary b { min-width: 22px; }
.fb-cbtn:has(.fb-neg-dot) { padding-right: 18px; }
/* артикулы WB в «Данных» — компактнее (21.10) */
.wb-rows { gap: 3px; }
.wb-row { grid-template-columns: 12px 150px minmax(0, 1fr) 16px 20px; gap: 6px; }
.wb-row select, .wb-row input { font-size: 13px; padding: 4px 8px; min-height: 0; height: 30px; }
.wb-swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid #d9cfb9; }
/* отчёт «Отзывы покупателей» v2 — легче (21.10) */
.fbr-kpis { align-items: flex-end; margin-bottom: 2px; }
.fbr-cmp { font-size: 11px; margin: 0 0 12px; }
.fbr-dist { flex-direction: row !important; gap: 6px; align-items: flex-end; }
.fbr-dist span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: #8a8172; }
.fbr-dist i { display: block; width: 14px; border-radius: 3px 3px 0 0; background: #e0a520; }
.fbr-dist i.s1, .fbr-dist i.s2 { background: #d0573a; } .fbr-dist i.s3 { background: #e08a2c; }
.fbr-card h3 { font-size: 14px; }
.fbr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fbr-table th { text-align: left; font-size: 11.5px; font-weight: 500; color: #8a8172; padding: 4px 8px; border-bottom: 1px solid var(--border); }
.fbr-table td { padding: 7px 8px; border-bottom: 1px solid #f1ece0; vertical-align: middle; }
.fbr-table tr:last-child td { border-bottom: none; }
.fbr-model { display: inline-flex; gap: 10px; align-items: center; }
.fbr-model img, .fbr-model .an-nophoto { width: 32px; height: 42px; object-fit: cover; border-radius: 5px; flex: none; }
.fbr-model > span { display: flex; flex-direction: column; }
.fbr-model a { font-weight: 600; }
.fbr-model small { font-size: 11.5px; color: #8a8172; max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fbr-num { white-space: nowrap; }
.fbr-num small { display: block; font-size: 11px; color: #8a8172; }
.fbr-mid { color: #a0700d; }
.fbr-themes { display: flex; flex-wrap: wrap; gap: 5px; }
.fbr-theme { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; background: #f8f1ea; border-radius: 8px; padding: 3px 9px; }
.fbr-theme b { color: #9a3a22; }
.fbr-theme em { font-style: normal; font-size: 11px; color: #34508a; }
.fbr-theme.ok { background: #eef6ef; }
/* «Данные» — компактные поля (21.10, Наташа: поля слишком большие и широкие) */
.basic-header-block .field-row { margin-bottom: 10px; }
.basic-header-block .field-row label { margin-bottom: 3px; font-size: 11.5px; }
.basic-header-block .field-row > input, .basic-header-block .field-row > select,
.basic-header-block .field-row > div > select, .basic-header-block .field-row select {
  padding: 5px 9px; font-size: 13.5px; height: 32px; max-width: 360px;
}
.basic-header-block .field-row > input { max-width: 360px; }
.basic-info-cols { gap: 18px 28px; }
.basic-col { flex: 0 1 380px; }
.basic-header-block .wb-row { grid-template-columns: 12px 150px 140px 16px 20px; justify-content: start; }
.basic-header-block .wb-row select, .basic-header-block .wb-row input { height: 28px; padding: 3px 8px; font-size: 13px; max-width: none; }
.basic-header-block .wb-add { padding: 3px 10px; font-size: 12px; }
/* «Данные» v2 — фото | Модель | Wildberries, снизу коллекции и фабрики (21.10) */
.bh-v2 { padding: 16px; background: transparent; border: none; }
.bh-grid { display: grid; grid-template-columns: 190px minmax(320px, 1.15fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.bh-photo img { width: 100%; border-radius: 12px; display: block; }
.bh-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.bh-card-h { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a7a5a; margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.bh-card-h .bh-count { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.bh-v2 .field-row { margin-bottom: 10px; }
.bh-v2 .field-row:last-child { margin-bottom: 0; }
.bh-v2 .field-row label { font-size: 11.5px; margin-bottom: 3px; }
.bh-v2 .field-row input, .bh-v2 .field-row select { height: 34px; padding: 5px 10px; font-size: 14px; max-width: none; }
.bh-row2 { display: grid; grid-template-columns: 150px 1fr; gap: 10px; }
.bh-wholesale-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.bh-sizing { grid-template-columns: 1fr 1fr; }
.bh-sizing .field-row { margin-bottom: 10px; }
.bh-wb .wb-rows { gap: 4px; }
.bh-wb .wb-row { grid-template-columns: 12px minmax(110px, 1fr) 118px 14px 16px; gap: 6px; justify-content: stretch; }
.bh-wb .wb-row select, .bh-wb .wb-row input { height: 30px; padding: 3px 8px; font-size: 13px; border: 1px solid var(--border); border-radius: 6px; background: var(--cream); width: 100%; box-sizing: border-box; }
.bh-wb .wb-row input { font-variant-numeric: tabular-nums; }
.bh-link { border: none; background: none; padding: 0; font: inherit; font-size: 12.5px; color: var(--wine, #6d0f1a); cursor: pointer; text-align: left; }
.bh-link:hover { text-decoration: underline; }
.bh-wb .wb-add { margin-top: 6px; }
.bh-prod { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; }
.bh-sub-h { font-size: 11.5px; font-weight: 600; color: #6b6553; margin-bottom: 6px; display: flex; gap: 10px; align-items: baseline; }
.bh-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bh-tag { background: #f3eee3; border-radius: 999px; padding: 3px 11px; font-size: 13px; }
.bh-empty { font-size: 13px; }
.bh-prod .pill-picker { gap: 6px; }
@media (max-width: 1100px) { .bh-grid { grid-template-columns: 160px 1fr; } .bh-wb { grid-column: 1 / -1; } .bh-prod { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .bh-grid { grid-template-columns: 1fr; } .bh-photo { max-width: 200px; } .bh-row2, .bh-sizing { grid-template-columns: 1fr; } }
.bh-sizing { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 10px; }
.bh-sizing .field-row { margin-bottom: 0; }
.bh-wb .wb-row { grid-template-columns: 12px minmax(100px, 1fr) 118px 14px 16px; }
/* отчёт отзывов: всё кликабельно (21.10) */
.fbr-pop { border: none; background: none; padding: 2px 4px; margin: -2px -4px; font: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
button.fbr-pop:hover { background: #f3eee3; }
.fbr-theme.fbr-pop { margin: 0; padding: 3px 9px; }
.fbr-theme.fbr-pop:hover { box-shadow: 0 0 0 1px #d9b9a8; }
.fbr-theme.ok.fbr-pop:hover { box-shadow: 0 0 0 1px #a9cdb0; }
.fbr-theme small { color: #6b8a70; }
.fbr-popbox { width: min(560px, 86vw); }
.fbr-popbox h4 { margin: 0 0 2px; }
.fbr-popdist > div { display: grid; grid-template-columns: 24px 1fr 30px; gap: 6px; align-items: center; font-size: 11.5px; margin-bottom: 2px; }
.fbr-popdist i { display: block; height: 7px; border-radius: 4px; background: #e0a520; min-width: 2px; }
.fbr-popdist i.s1, .fbr-popdist i.s2 { background: #d0573a; } .fbr-popdist i.s3 { background: #e08a2c; }
.fbr-popdist b { text-align: right; font-size: 11px; }
.fbr-popcolors { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin: 8px 0 4px; color: #6b6553; }
.fbr-poplist { max-height: 46vh; overflow: auto; margin-top: 6px; border-top: 1px solid #f1ece0; }
.fbr-popmore { display: inline-block; margin-top: 8px; font-size: 12.5px; }
.an-pop:has(.fbr-popbox) { max-width: min(600px, 92vw); width: auto; box-sizing: border-box; }
.fbr-popbox, .fbr-popbox * { box-sizing: border-box; }
.fbr-popbox .fb-text, .fbr-popbox .fb-pc { overflow-wrap: anywhere; }
/* фильтр по звёздам и цветам в окне отзывов (21.10) */
.fbr-popdist button { display: grid; grid-template-columns: 24px 1fr 32px; gap: 6px; align-items: center; width: 100%; border: none; background: none; padding: 2px 4px; margin: 0 -4px; font: inherit; font-size: 11.5px; cursor: pointer; border-radius: 6px; }
.fbr-popdist button:hover:not(:disabled) { background: #f6f1e6; }
.fbr-popdist button.on { background: #efe4cc; font-weight: 700; }
.fbr-popdist button.empty { opacity: .45; cursor: default; }
.fbr-popdist button i { display: block; height: 7px; border-radius: 4px; background: #e0a520; min-width: 2px; }
.fbr-popdist button i.s1, .fbr-popdist button i.s2 { background: #d0573a; } .fbr-popdist button i.s3 { background: #e08a2c; }
.fbr-popdist button b { text-align: right; font-size: 11px; }
.fbr-popcolors button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; color: #4a4232; }
.fbr-popcolors button.on { background: #3d362a; color: #fff; border-color: #3d362a; }
.fbr-pf-reset { border: none; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--wine, #6d0f1a); cursor: pointer; margin-top: 6px; }
.fbr-pf-hint { font-size: 11px; margin: 6px 0 0; }
.fbr-popcolors button.empty { opacity: .45; }
.fbr-pf-cap { font-size: 12px; font-weight: 600; margin: 0 0 4px; }
/* отзывы: «жалуются / хвалят» как статистика (21.10) */
.fb-sum { gap: 12px; margin: 4px 0 14px; }
.fb-stat { border-radius: 14px; padding: 12px 14px; border: 1px solid; }
.fb-stat.neg { background: #fdf3f0; border-color: #f2d3c8; }
.fb-stat.pos { background: #f1f8f2; border-color: #cfe5d3; }
.fb-stat-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.fb-stat-h b { font-size: 14px; }
.fb-stat.neg .fb-stat-h b { color: #8a2f1b; } .fb-stat.pos .fb-stat-h b { color: #2f6a3a; }
.fb-stat-h span { font-size: 11.5px; color: #8a8172; }
.fb-stat-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 1fr 30px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; }
.fb-stat-l { color: #3d362a; }
.fb-stat-bar { height: 8px; background: rgba(0,0,0,.05); border-radius: 4px; overflow: hidden; }
.fb-stat-bar i { display: block; height: 100%; border-radius: 4px; }
.fb-stat.neg .fb-stat-bar i { background: #d9785d; } .fb-stat.pos .fb-stat-bar i { background: #6fae7b; }
.fb-stat-row b { text-align: right; font-variant-numeric: tabular-nums; }
.fb-stat-empty { font-size: 12.5px; margin: 0; }
/* «Решения аналитики» → продажи на WB (22.10) */
.an-wbs { display: flex; flex-direction: column; gap: 1px; font-size: 12px; align-items: flex-start; min-width: 130px; }
.an-wbs b { font-size: 14px; }
.an-wbs small { font-size: 11px; }
.an-wbart { margin-top: 4px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 2px 9px; font: inherit; font-size: 11.5px; color: #4a4232; cursor: pointer; }
.an-wbart:hover { border-color: #b59a5d; }
.an-wbtable { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.an-wbtable th { text-align: left; font-weight: 500; color: #8a8172; font-size: 11px; padding: 3px 6px; border-bottom: 1px solid var(--border); }
.an-wbtable td { padding: 4px 6px; border-bottom: 1px solid #f1ece0; }
.an-wbtable a { color: #4a4232; text-decoration: none; font-variant-numeric: tabular-nums; }
.an-wbtable a:hover { color: var(--wine, #6d0f1a); }
/* сортировка колонок «Решений аналитики» (22.10) */
.th-sort { border: none; background: none; padding: 0 3px; margin-left: 2px; font-size: 12px; color: #a8a089; cursor: pointer; border-radius: 4px; line-height: 1; }
.th-sort:hover { background: #efe8d8; color: #4a4232; }
.th-sort.on { color: #6d0f1a; background: #f3e7d4; font-weight: 700; }
.th-sort-menu { display: flex; flex-direction: column; gap: 2px; min-width: 210px; }
.th-sort-menu b { font-size: 12px; margin-bottom: 4px; }
.th-sort-menu button { border: none; background: none; text-align: left; padding: 5px 8px; border-radius: 6px; font: inherit; font-size: 12.5px; cursor: pointer; }
.th-sort-menu button:hover { background: #f6f1e6; }
.th-sort-menu button.on { background: #efe4cc; font-weight: 600; }
/* ячейка «Продажи на WB» — по центру */
.an-wbs { align-items: center; text-align: center; margin: 0 auto; }
.an-wbs.empty { gap: 0; }
.an-wbs-none { font-size: 12.5px; color: #8a8172; }
.an-wbs.empty small { color: #b0a890; }
.ue-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .ue-bulk .muted { font-size: 12px; }
/* «Краткое ТЗ» — окно заполнения (23.10, Мария): референс закреплён слева, ткани крупнее */
.modal-content.tz-modal { width: min(1180px, 96vw); max-width: none; }
.tz-layout.has-ref { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.tz-ref { position: sticky; top: 0; align-self: start; }
.tz-ref-main { border-radius: 10px; overflow: hidden; background: #f3eee3; }
.tz-ref-main img { width: 100%; max-height: 62vh; object-fit: contain; display: block; cursor: zoom-in; }
.tz-ref-thumbs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tz-ref-thumbs img { width: 44px; height: 56px; object-fit: cover; border-radius: 5px; cursor: pointer; opacity: .65; border: 2px solid transparent; }
.tz-ref-thumbs img.on, .tz-ref-thumbs img:hover { opacity: 1; border-color: #b59a5d; }
.tz-ref .muted { font-size: 11px; margin: 6px 0 0; }
.tz-form { min-width: 0; }
.tz-modal .fabric-swatch-grid { gap: 8px; }
.tz-modal .fabric-swatch { width: 92px; height: 92px; border-radius: 8px; position: relative; overflow: visible; transition: transform .15s; }
.tz-modal .fabric-swatch img { border-radius: 6px; }
.tz-modal .fabric-swatch:hover { transform: scale(2.4); z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.tz-modal .reference-tile img { max-height: 180px; object-fit: cover; }
.tz-grid3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.tz-buttons { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 10px; background: #faf6ec; border-radius: 8px; margin: 4px 0 10px; font-size: 13px; }
.tz-buttons select, .tz-buttons input { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font: inherit; font-size: 13px; background: #fff; }
.tz-buttons input { width: 80px; }
@media (max-width: 900px) { .tz-layout.has-ref { grid-template-columns: 1fr; } .tz-ref { position: static; max-width: 300px; } .tz-grid3 { grid-template-columns: 1fr; } }
/* КТЗ: состав ткани по галочке, ткани без фото — с номером (29.10) */
.tz-comp-toggle { display: flex; gap: 6px; align-items: center; font-size: 12.5px; margin: 0 0 8px; cursor: pointer; }
.fabric-swatch .sw-name { display: none; }
.fabric-swatch.nophoto { background: #f3eee3; display: flex; align-items: center; justify-content: center; }
.fabric-swatch.nophoto .sw-name { display: block; font-size: 11px; color: #6b6553; text-align: center; padding: 2px; word-break: break-word; }
/* «Только просмотр» (30.10) */
#read-only-bar { position: sticky; top: 0; z-index: 900; background: #3d362a; color: #f3eee3; text-align: center; font-size: 13px; padding: 6px 12px; }
body.read-only #new-product-btn { display: none; }
.ro-tag { background: #eef1f6; color: #3b4b66; border-radius: 6px; padding: 0 6px; font-size: 12px; }
.user-row-actions { display: inline-flex; gap: 8px; align-items: center; }
.ro-check { display: inline-flex; gap: 5px; align-items: center; font-size: 12.5px; color: #4a4232; cursor: pointer; white-space: nowrap; }
/* Производства: поиск */
.prod-search { min-width: 260px; margin-right: 6px; position: relative; }
.prod-search-x { border: none; background: none; font-size: 16px; color: #8a8172; cursor: pointer; padding: 0 4px; }

/* 30.10: поиск в выборе ткани/фурнитуры (Себестоимость) */
.cost-item-pick { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.cost-item-pick .cost-item-search { width: 120px; flex: 0 0 120px; height: 28px; border: 1px solid var(--border); border-radius: 7px; padding: 0 8px; font-size: 12px; background: var(--white); }
.cost-item-pick select { flex: 1; min-width: 0; }
.cost-item-row .cost-item-pick select.listing { height: auto; padding: 2px; }

.notification-settings { max-width: 920px; display: grid; gap: 14px; }
.notification-panel { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.notification-panel h3 { margin: 0 0 10px; font-size: 16px; }
.notification-main-toggle, .notification-check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.notification-main-toggle { font-weight: 700; }
.notification-label { display: block; margin: 16px 0 6px; font-weight: 600; font-size: 13px; }
.notification-topic-input { width: 100%; max-width: 680px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; font-size: 14px; }
.notification-help { margin-top: 6px; font-size: 12px; }
.notification-event-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.notification-check { font-size: 14px; }
.notification-stage-table-wrap { overflow-x: auto; }
.notification-stage-table { width: 100%; border-collapse: collapse; }
.notification-stage-table th, .notification-stage-table td { border-bottom: 1px solid var(--border); padding: 9px 8px; text-align: left; }
.notification-stage-table th:not(:first-child), .notification-stage-table td:not(:first-child) { text-align: center; width: 130px; }
.notification-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fitting-session-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 16px; }
.fitting-session-card { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; padding: 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); color: var(--text); text-decoration: none; }
.fitting-session-card:hover { border-color: #b59a5d; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.fitting-session-date { font-weight: 700; font-size: 16px; }
.fitting-session-place { grid-column: 1 / -1; color: #665c4d; }
.fitting-session-card small { color: #8a8172; }
.fitting-product-card { margin: 12px 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--white); overflow: visible; }
.fitting-product-card.collapsed .fitting-card-body { display: none; }
.fitting-product-card.collapsed .fitting-collapse-arrow { transform: rotate(-90deg); }
.fitting-product-card:not(.collapsed) .fitting-collapse-arrow { transform: rotate(0); }
.fitting-product-card.fitting-removed { opacity: .72; }
.fitting-product-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
.fitting-product-toggle { cursor: pointer; }
.fitting-product-toggle:hover { background: #fbf8f1; }
.fitting-product-toggle:focus { outline: 2px solid var(--gold); outline-offset: -2px; }
.fitting-collapse-arrow { margin-left: auto; color: #8a826e; font-size: 20px; transition: transform .15s ease; }
.fitting-product-title { display: block; font-size: 17px; }
.fitting-card-body { padding: 0 14px 14px; border-top: 1px solid #eee8dd; }
.fitting-detail-loading { display:flex; align-items:center; gap:10px; min-height:52px; padding:10px 2px; color:var(--muted,#81796c); font-size:13px; }
.fitting-detail-loading .loading-spinner { flex:0 0 auto; width:18px; height:18px; border-width:2px; }
.fitting-detail-loading.is-error { color:var(--wine,#60000b); }
.fitting-open-product { display: inline-block; margin: 10px 0 0; color: var(--wine); font-size: 12px; text-decoration: none; }
.fitting-open-product:hover { text-decoration: underline; }
.fitting-product-head a { color: inherit; text-decoration: none; }
.fitting-product-head a:hover { color: var(--wine, #6d0f1a); }
.fitting-product-head a b { font-size: 17px; }
.fitting-product-head a + span { display: block; color: #8a8172; font-size: 12px; margin-top: 3px; }
.fitting-meta { color: #776f60; font-size: 12px; text-align: right; }
.fitting-prices { display: flex; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin: 12px 0; padding: 10px; background: #f7f3eb; border-radius: 8px; font-size: 12px; }
.fitting-price-country { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.fitting-price-country b { margin-right: 3px; }
.fitting-detail { border-top: 1px solid #eee8dd; padding: 9px 0; }
.fitting-detail > summary, .fitting-color-grid > summary, .fitting-old-items > summary { cursor: pointer; font-weight: 600; }
.fitting-photos { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; }
.fitting-photo { width: 92px; color: #6d0f1a; text-decoration: none; font-size: 10px; }
.fitting-photo img { display: block; width: 92px; height: 112px; object-fit: cover; border-radius: 6px; background: #f3eee3; }
.fitting-photo small { display: block; overflow-wrap: anywhere; margin-top: 3px; }
.fitting-size-table { border-collapse: collapse; font-size: 11px; }
.fitting-size-table th, .fitting-size-table td { border: 1px solid var(--border); padding: 5px 8px; text-align: center; white-space: nowrap; }
.fitting-size-table td small { display: block; font-size: 9px; }
.fitting-size-table td em { display: block; font-size: 9px; font-style: normal; color: #665c4d; }
.fitting-size-table td.sizegrid-dev-exact { background: #e3f2e6; }
.fitting-size-table td.sizegrid-dev-warn { background: #faf1d9; }
.fitting-size-table td.sizegrid-dev-bad { background: #f9e2e2; }
.fitting-color-grid { margin-top: 8px; }
.fitting-issues { max-width: 1100px; border-top: 1px solid #eee8dd; padding-top: 10px; margin-top: 6px; display: grid; gap: 8px; }
.fitting-issue { padding: 9px; border-radius: 7px; background: #fff8ef; display: grid; gap: 5px; font-size: 13px; }
.fitting-issue.resolved { background: #edf6ed; }
.fitting-issue-status { font-weight: 700; }
.fitting-done { margin-left: 7px; color: #247345; font-size: 11px; }
.fitting-issue-form { display: grid; grid-template-columns: minmax(170px, 240px) minmax(220px, 1fr) auto; gap: 7px; align-items: start; max-width: 980px; }
.fitting-issue-form textarea { min-height: 34px; }
.fitting-old-items { margin-top: 12px; padding: 10px; border: 1px dashed var(--border); border-radius: 8px; }
.fitting-status-list { max-width: 760px; margin: 12px 0; }
.fitting-status-row > span:last-child { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fitting-status-row select { min-width: 145px; }
.fitting-product-search-results { display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.fitting-product-result { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--white); color: var(--text); text-align: left; }
.fitting-product-result:hover { border-color: #b59a5d; background: #fbf8f1; }
.fitting-product-result span { color: #8a8172; font-size: 12px; }
.fitting-selected-products { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fitting-selected-chip { border: 1px solid #d8c9a8; border-radius: 16px; padding: 5px 10px; background: #f7f3eb; color: var(--text); cursor: pointer; }
.fitting-view-controls { display: inline-flex; align-items: center; flex-wrap: wrap; }
.fitting-product-result { display: grid; grid-template-columns: 54px minmax(150px,1fr) minmax(170px,240px) auto; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.fitting-product-result > img, .fitting-search-no-photo { display: grid; place-items: center; width: 50px; height: 58px; border-radius: 5px; object-fit: cover; background: #f3eee3; color: #8a8172; font-size: 9px; }
.fitting-result-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fitting-result-copy b, .fitting-result-copy span, .fitting-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitting-result-copy small { color: #8a8172; font-size: 11px; }
.fitting-result-factory { display: grid; gap: 3px; min-width: 0; color: #776f60; font-size: 10px; }
.fitting-result-factory select { width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid #ded7c8; border-radius: 7px; background: #fff; color: var(--text); font: inherit; font-size: 12px; }
.fitting-product-result > .btn { white-space: nowrap; }
.fitting-products-toolbar { margin: 18px 0 12px; }
.fitting-products-toolbar .search-pill { max-width: 760px; height: 42px; }
.fitting-products-toolbar .fitting-status-settings-button { margin-left: auto; }
.fitting-filter-pills { gap: 10px; margin: 12px 0 18px; }
.fitting-filter-pills .filter-pill { height: 42px; padding-left: 18px; padding-right: 34px; font-size: 14px; }
.fitting-filter-pills .filter-pill.on { background: var(--ink); border-color: var(--ink); }
.fitting-date-pill::after { display: none; }
.fitting-date-pill { padding-right: 18px !important; }
.fitting-date-pill input.filter-pill-select { inset: 0; cursor: pointer; }
.fitting-list-controls { justify-content: space-between; gap: 16px; margin: 12px 0 16px; }
.fitting-sort-controls, .fitting-view-group { display: flex; align-items: center; gap: 10px; color: #8a826e; font-size: 13px; }
.fitting-sort-controls .kanban-seg, .fitting-view-group .kanban-seg { background: var(--white); }
.fitting-table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 9px; background: var(--white); }
.fitting-session-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.fitting-session-table th, .fitting-session-table td { padding: 9px 11px; text-align: left; border-bottom: 1px solid #eee8dd; }
.fitting-session-table th { background: #f8f5ee; color: #665c4d; font-size: 12px; }
.fitting-session-table th button { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.fitting-session-table tr:last-child td { border-bottom: 0; }
.fitting-session-table tbody tr:hover { background: #fbf8f1; }
.fitting-session-table tbody tr:focus { outline: 2px solid var(--gold); outline-offset: -2px; }
.fitting-session-previews { display: flex; align-items: center; gap: 5px; min-width: 118px; }
.fitting-session-thumb { display: block; width: 68px; height: 82px; object-fit: cover; border-radius: 5px; background: #f3eee3; }
.fitting-session-thumb-empty { display: grid; place-items: center; padding: 2px; overflow: hidden; text-align: center; line-height: 1.1; }
.fitting-view-small .fitting-session-thumb { width: 50px; height: 62px; }
.fitting-view-medium .fitting-session-thumb { width: 96px; height: 116px; }
.fitting-view-large .fitting-session-thumb { width: 142px; height: 172px; }
.fitting-session-more { color: #776f60; font-size: 12px; font-weight: 700; }
.fitting-view-none .fitting-session-thumb { display: none; }
.fitting-view-none .fitting-session-table { min-width: 590px; }
.fitting-toolbar { justify-content: space-between; align-items: center; }
.fitting-detail-search { max-width: 650px; margin: 12px 0; }
.fitting-detail-search input { width: 100%; }
.fitting-product-list { display: grid; gap: 12px; }
.fitting-product-identity { display: flex; align-items: center; gap: 12px; min-width: min(100%, 360px); }
.fitting-product-identity > span { display: flex; flex-direction: column; }
.fitting-cover { position: relative; z-index: 1; display: block; flex: 0 0 auto; width: 64px; height: 78px; border-radius: 6px; background: #f3eee3; }
.fitting-cover img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: transform .18s ease, box-shadow .18s ease; transform-origin: top left; }
.fitting-cover:hover { z-index: 10; }
.fitting-cover:hover img { transform: scale(2.4); box-shadow: 0 8px 26px rgba(0,0,0,.3); }
.fitting-cover-empty { display: grid; place-items: center; color: #8a8172; font-size: 10px; }
.fitting-view-medium .fitting-cover { width: 112px; height: 138px; }
.fitting-view-large .fitting-cover { width: 170px; height: 210px; }
.fitting-view-none .fitting-cover { display: none; }
.fitting-prices { align-items: center; margin: 14px 0; padding: 12px 14px; background: #f6f0e2; border: 1px solid #e6d9bd; font-size: 14px; }
.fitting-prices > b { font-size: 14px; margin-right: 8px; }
.fitting-price-country { align-items: center; gap: 8px 18px; padding: 3px 8px; }
.fitting-price-country > b { font-size: 14px; color: #4b3b1b; }
.fitting-price-country > span { display: grid; gap: 1px; }
.fitting-price-country small { color: #776f60; font-size: 10px; }
.fitting-price-country strong { color: #241d11; font-size: 16px; }
.fitting-resolution-form, .product-fitting-add-comment { display: grid; grid-template-columns: minmax(200px,1fr) auto; gap: 8px; align-items: start; max-width: 820px; }
.fitting-resolution-form textarea, .product-fitting-add-comment textarea { width: 100%; }
.fitting-resolve-button { align-self: end; min-height: 36px; background: #e3f2e6; border-color: #9ac6a5; color: #1c6434; font-weight: 700; }
.fitting-resolution { padding: 7px 9px; border-left: 3px solid #64a779; background: #f2f8f2; color: #275a36; }
.product-fitting-history { width: 100%; max-width: none; box-sizing: border-box; }
.product-fitting-entry { width: 100%; box-sizing: border-box; margin: 9px 0; padding: 10px 12px; border: 1px solid #d8cfbd; border-left: 4px solid #a68a58; border-radius: 9px; background: #fffefa; }
.product-fitting-entry:nth-of-type(4n+2) { border-left-color: #718c7a; background: #fbfdfb; }
.product-fitting-entry:nth-of-type(4n+3) { border-left-color: #8c789a; background: #fdfbfe; }
.product-fitting-entry:nth-of-type(4n+4) { border-left-color: #9a7666; background: #fefbf9; }
.product-fitting-entry.is-removed { opacity: .75; }
.product-fitting-entry > header { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.product-fitting-entry > header small { color: #8a8172; }
.product-fitting-entry > header > b { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.product-fitting-round-label { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #f0e8d7; color: #655433; font-size: 11px; }
.product-fitting-issue { display: grid; gap: 6px; margin: 8px 0; padding: 10px; border-radius: 7px; background: #fff8ef; }
.product-fitting-issue.resolved { background: #edf6ed; }
.product-fitting-issue p { margin: 0; }
.product-fitting-add-comment { grid-template-columns: minmax(190px,240px) minmax(220px,1fr) auto; margin-top: 12px; max-width: 980px; }
.fitting-card-empty { padding: 18px; border: 1px dashed var(--border); border-radius: 9px; background: #fbf8f1; }
.fitting-card-empty h2 { margin-top: 0; }
[data-fit-product-card][hidden], .fitting-session-table tr[hidden] { display: none !important; }
@media (max-width: 800px) { .fitting-products-toolbar .fitting-status-settings-button { margin-left: 0; } .fitting-list-controls, .fitting-sort-controls, .fitting-view-group { align-items: flex-start; flex-direction: column; } .product-fitting-add-comment { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .fitting-issue-form { grid-template-columns: 1fr; } .fitting-meta { text-align: left; } }
@media (max-width: 600px) {
  .notification-panel { padding: 12px; }
  .notification-stage-table th:not(:first-child), .notification-stage-table td:not(:first-child) { width: 90px; }
}

/* Примерки: панель действий собрана в одну ровную строку */
.fitting-detail-toolbar { display: flex; align-items: center; gap: 10px; margin: 14px 0 20px; min-width: 0; }
.fitting-detail-toolbar .btn { min-height: 40px; white-space: nowrap; border-radius: 999px; padding: 0 15px; }
.fitting-session-edit-button { background: #fff; border-color: #ded7c8; color: #514936; }
.fitting-add-product-button { flex: 0 0 auto; }
.fitting-inline-search { display: flex; align-items: center; gap: 9px; flex: 1 1 250px; min-width: 180px; max-width: 520px; height: 42px; box-sizing: border-box; padding: 0 14px; border: 1px solid #ded7c8; border-radius: 999px; background: #fff; color: #8a8172; }
.fitting-inline-search > span { font-size: 23px; line-height: 1; }
.fitting-inline-search input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text); }
.fitting-inline-search:focus-within { border-color: #b59a5d; box-shadow: 0 0 0 3px rgba(181,154,93,.12); }
.fitting-detail-toolbar .fitting-view-controls { margin-left: auto; flex: 0 0 auto; }
.fitting-session-previews { width: max-content; max-width: none; flex-wrap: nowrap; white-space: nowrap; }
.fitting-session-previews > * { flex: 0 0 auto; }
.fitting-session-table td:first-child { white-space: nowrap; }
.fitting-product-card .fitting-issue { border: 1px solid #eee4d6; padding: 12px 14px; border-radius: 10px; }
.fitting-issue.deleted, .product-fitting-issue.deleted { opacity: .64; background: #f5f3ef; }
.fitting-issue-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.fitting-issue-comment, .product-fitting-issue p { white-space: pre-wrap; overflow-wrap: anywhere; }
.fitting-issue-deleted-tag { border-radius: 999px; padding: 2px 9px; background: #ece8e1; color: #746c60; font-size: 11px; }
.fitting-issue-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.fitting-issue-editor { display: grid; grid-template-columns: minmax(180px, 260px) minmax(240px, 1fr); align-items: start; gap: 8px; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.72); }
.fitting-issue-editor > div { grid-column: 1 / -1; display: flex; gap: 7px; }
.fitting-issue-editor select, .fitting-issue-editor textarea { width: 100%; box-sizing: border-box; border: 1px solid #ded7c8; border-radius: 7px; padding: 8px 10px; font: inherit; background: #fff; }
.fitting-area-list, .fitting-status-list { max-width: 900px; display: grid; gap: 8px; margin: 12px 0 18px; }
.fitting-area-row, .fitting-status-row { display: grid; grid-template-columns: minmax(180px,1fr) minmax(160px,230px) auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.fitting-area-row { grid-template-columns: minmax(180px,1fr) auto; }
.fitting-area-row > span, .fitting-status-row > span { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.fitting-area-add, .fitting-status-add { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 900px; margin: 10px 0 26px; }
.fitting-area-add input, .fitting-status-add input { flex: 1 1 260px; }
.fitting-status-add select { flex: 0 1 230px; }
.fitting-status-row select { width: 100%; min-width: 0; }
.fitting-add-selected-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.fitting-selected-products { min-height: 4px; }
.fitting-product-result.selected { border-color: #8a9b72; background: #f0f4e9; box-shadow: inset 3px 0 #74895a; }
.fitting-grid-toolbar, .sizegrid-round-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 12px; }
.sizegrid-toolbar-field { display: inline-flex; align-items: center; gap: 7px; color: #776f60; font-size: 12px; }
.sizegrid-toolbar-field select { min-width: 150px; max-width: min(420px, 55vw); padding: 7px 10px; border: 1px solid #ded7c8; border-radius: 8px; background: #fff; color: var(--text); font: inherit; }
.sizegrid-compact-table { min-width: max-content; }
.sizegrid-compact-table th { white-space: normal; min-width: 76px; }
.sizegrid-compact-table td { min-width: 76px; }
.sizegrid-compact-table .sizegrid-qc-col { min-width: 72px; text-align: center; }
.fitting-editable-size-table { min-width: max-content; }
.fitting-editable-size-table th { white-space: normal; min-width: 82px; }
.fitting-editable-size-table td { min-width: 78px; }
.fit-measure-input { width: 72px; max-width: 100%; box-sizing: border-box; padding: 5px 6px; border: 1px solid transparent; border-radius: 6px; background: rgba(255,255,255,.8); color: var(--text); text-align: center; font: inherit; }
.fit-measure-input:hover, .fit-measure-input:focus { border-color: #c9b98e; outline: none; background: #fff; }
.fitting-measure-fact { transition: background-color .15s ease; }
.fitting-grid-save-state { color: #776f60; font-size: 11px; }
.fitting-selected-chip { display: inline-grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 4px 10px; max-width: 100%; text-align: left; }
.fitting-selected-chip span { overflow: hidden; color: #776f60; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.fitting-selected-chip i { font-style: normal; font-weight: 700; }
.fitting-resolution { display: block; flex-basis: 100%; max-width: 900px; margin: 2px 0 0; padding: 6px 9px; border-left: 3px solid #64a779; border-radius: 0 6px 6px 0; background: #f2f8f2; color: #275a36; white-space: pre-wrap; overflow-wrap: anywhere; }
.sizegrid-separated-section { margin: 16px 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.sizegrid-separated-section > h3 { margin: 0 0 10px; font-size: 15px; }
.sizegrid-round-section { margin: 8px 0; border: 1px solid #e8e1d5; border-radius: 9px; background: #fff; }
.sizegrid-round-section > summary { position: relative; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.sizegrid-round-title { flex: 1 1 auto; min-width: 220px; }
.sizegrid-round-actions { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; margin-left: auto; }
.sizegrid-round-section .fitting-round-link { color: var(--wine, #4F0005); font-size: 11px; font-weight: 500; text-decoration: none; }
.sizegrid-round-section .fitting-round-link:hover { text-decoration: underline; }
.sizegrid-round-section > .table-scroll { margin: 0 10px 10px; }
.sizegrid-reference-cell { background: #f7f5f0; color: #625c51; }
.sizegrid-round-section .sizegrid-round-delete { position: static; transform: none; flex: 0 0 auto; padding: 5px 10px; border: 1px solid #ded7c8; border-radius: 999px; background: #fff; color: #776f60; font: inherit; font-size: 11px; cursor: pointer; }
.sizegrid-round-section .sizegrid-round-delete:hover { border-color: #bd5145; color: #a6372d; }
.sizegrid-plan-section thead th { position: relative; }
.sizegrid-plan-section .sizegrid-custom-measurement-delete { position: absolute; }
.sizegrid-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.sizegrid-section-heading h3 { margin: 0; font-size: 15px; }
.sizegrid-plan-clear { flex: 0 0 auto; }
.sizegrid-loading, .sizegrid-load-error { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: #776f60; }
.sizegrid-load-error { color: #8f3027; background: #fff8f6; }
.product-detail-loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 240px; color: #776f60; font-size: 15px; }
.loading-spinner { width: 22px; height: 22px; border: 3px solid #e8e1d5; border-top-color: var(--wine); border-radius: 50%; animation: product-load-spin .8s linear infinite; }
@keyframes product-load-spin { to { transform: rotate(360deg); } }
.sizegrid-plan-table { border: 2px solid #8b1824; }
.sizegrid-plan-table thead th { background: #f5e9e8; color: #581018; font-weight: 800; }
.sizegrid-fact-table { border: 2px solid #427452; }
.sizegrid-fact-table thead th { background: #eaf3eb; color: #285638; font-weight: 700; }
.sizegrid-reference-table { border: 1px solid #b9b1a2; }
.sizegrid-separated-section > h3 { font-weight: 800; }
.fitting-plan-heading { background: #f5e9e8 !important; color: #581018 !important; font-size: 13px; font-weight: 800 !important; }
.fitting-fact-heading { background: #eaf3eb !important; color: #285638 !important; font-size: 13px; font-weight: 800 !important; }
.sizegrid-qc-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 60px; padding: 4px; border: 1px solid #ded7c8; border-radius: 8px; background: #fff; color: #514936; font: inherit; font-size: 10px; cursor: pointer; }
.sizegrid-qc-btn:hover { border-color: #b59a5d; background: #fbf8f1; }
.sizegrid-qc-btn img { display: block; width: 46px; height: 48px; border-radius: 5px; object-fit: cover; background: #f3eee3; }
.fitting-size-grid-scroll .sizegrid-qc-btn img { width: 48px; height: 50px; }
.fitting-photo-library { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.fitting-photo-library > summary { cursor: pointer; color: #514936; font-weight: 700; }
.fitting-photo-group { margin: 8px 0 0 10px; }
.fitting-photo-group > summary { cursor: pointer; color: #776f60; font-size: 12px; }
.fitting-photo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; padding: 9px 0; }
.fitting-photo-tile { min-width: 0; padding: 5px; border: 1px solid #e8e1d5; border-radius: 8px; background: #fff; color: #625c51; text-align: left; cursor: pointer; }
.fitting-photo-tile img { display: block; width: 100%; height: 105px; border-radius: 5px; object-fit: cover; background: #f3eee3; }
.fitting-photo-tile span { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.fitting-previous-history { margin: 10px 0; padding: 10px 12px; border: 1px solid #ded7c8; border-radius: 9px; background: #faf8f3; }
.fitting-previous-history > summary { cursor: pointer; color: #514936; font-weight: 700; }
.fitting-history-round { margin-top: 10px; padding: 10px; border: 1px solid #e8e1d5; border-radius: 8px; background: #fff; }
.fitting-history-round > header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.fitting-history-round > header small, .fitting-history-issue > small { color: #8a8172; font-size: 10px; }
.fitting-history-issues { display: grid; gap: 6px; }
.fitting-history-issue { padding: 7px 9px; border-left: 3px solid #b59a5d; border-radius: 0 6px 6px 0; background: #fbf8f1; }
.fitting-history-issue.resolved { border-left-color: #64a779; background: #f2f8f2; }
.fitting-history-issue.deleted { opacity: .7; }
.fitting-history-issue > div { display: flex; align-items: center; gap: 8px; }
.fitting-history-issue p { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fitting-history-resolution { color: #275a36; font-size: 12px; }
/* Accordions in the fitting card share one aligned, compact header treatment. */
.fitting-detail { margin: 8px 0 0; padding: 0; border: 1px solid #e8e1d5; border-radius: 9px; background: #fff; overflow: hidden; }
.fitting-detail > summary { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 13px; color: #514936; font-weight: 700; list-style: none; }
.fitting-detail > summary::-webkit-details-marker { display: none; }
.fitting-detail > summary::before { content: '›'; width: 18px; color: #8a826e; font-size: 21px; line-height: 1; transition: transform .15s ease; }
.fitting-detail[open] > summary::before { transform: rotate(90deg); }
.fitting-detail[open] > .table-scroll, .fitting-detail[open] > .fitting-photo-group, .fitting-detail[open] > .fitting-photo-gallery { margin: 0 12px 12px; }
.fitting-photo-library { margin: 8px 0 0; padding: 0; }
.fitting-photo-library .fitting-photo-group { margin-left: 18px; margin-right: 12px; }
@media (max-width: 680px) {
  .fitting-product-result { grid-template-columns: 48px minmax(0,1fr); }
  .fitting-product-result > img, .fitting-search-no-photo { width: 44px; height: 52px; }
  .fitting-result-factory { grid-column: 2; }
  .fitting-product-result > .btn { grid-column: 2; justify-self: start; }
}
@media (max-width: 1120px) {
  .fitting-detail-toolbar { flex-wrap: wrap; }
  .fitting-detail-toolbar .fitting-inline-search { order: 3; flex-basis: 100%; max-width: none; }
  .fitting-detail-toolbar .fitting-view-controls { margin-left: auto; }
}
@media (max-width: 700px) {
  .fitting-status-row { grid-template-columns: 1fr; }
  .fitting-status-row > span { justify-content: flex-start; }
  .fitting-area-row { grid-template-columns: 1fr; }
  .fitting-area-row > span { justify-content: flex-start; }
  .fitting-issue-editor { grid-template-columns: 1fr; }
  .fitting-issue-editor > div { grid-column: auto; }
  .fitting-detail-toolbar .fitting-view-controls { margin-left: 0; }
}

/* Компактные элементы раздела «Примерки» */
.fitting-products-toolbar { gap: 9px; margin: 12px 0 8px; }
.fitting-products-toolbar > .btn { min-height: 36px; height: 36px; padding: 0 13px; font-size: 13px; }
.fitting-products-toolbar .search-pill { height: 36px; max-width: 520px; min-width: 200px; }
.fitting-filter-pills { gap: 6px; margin: 8px 0 12px; }
.fitting-filter-pills .filter-pill { height: 34px; padding-left: 12px; padding-right: 25px; gap: 5px; font-size: 12px; }
.fitting-filter-pills .fitting-date-pill { padding-right: 9px !important; }
.fitting-date-trigger { display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 0; color: var(--ink); background: transparent; font: inherit; font-weight: 600; cursor: pointer; }
.fitting-date-input { position: absolute; z-index: 2; right: 4px; bottom: 2px; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.fitting-list-controls { margin: 8px 0 12px; }
.fitting-product-head { display: grid; grid-template-columns: minmax(0,1fr) minmax(150px,220px) auto 24px; align-items: center; gap: 10px; }
.fitting-product-identity { min-width: 0; }
.fitting-product-article-link { display: flex; min-width: 0; flex-direction: column; color: inherit; text-decoration: none; }
.fitting-product-article-link:hover .fitting-product-title { color: var(--wine); text-decoration: underline; }
.fitting-product-article-link > span { color: #827966; font-size: 12px; }
.fitting-meta { grid-column: 2; grid-row: 1; }
.fitting-product-head [data-fit-remove], .fitting-product-head [data-fit-restore] { grid-column: 3; grid-row: 1; white-space: nowrap; }
.fitting-collapse-arrow { grid-column: 4; grid-row: 1; }
.fitting-issues { max-width: none; padding-top: 8px; }
.fitting-issue-list { display: grid; gap: 4px; }
.fitting-issue-row { display: grid; grid-template-columns: minmax(115px,180px) minmax(100px,1fr) minmax(130px,190px) auto; align-items: center; gap: 8px; min-height: 34px; padding: 4px 7px; border: 1px solid #eee8dd; border-radius: 8px; background: #fff; font-size: 12px; }
.fitting-issue-row.resolved { background: #f4f8f2; }
.fitting-issue-row.deleted { grid-template-columns: minmax(115px,180px) minmax(100px,1fr) minmax(150px,240px) auto; background: #f4f2ee; opacity: .72; }
.fitting-issue-row .fitting-issue-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitting-issue-comment { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitting-issue-row > small { color: #8a8172; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fitting-issue-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.fitting-icon-action { display: inline-grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 1px solid #e2dacb; border-radius: 50%; color: #5e5545; background: #fff; font-size: 16px; cursor: pointer; }
.fitting-icon-action:hover { background: #f5f0e5; border-color: #cbbb9e; }
.fitting-icon-action.delete { color: #a64435; }
.fitting-resolution-inline { display: inline-flex; align-items: center; gap: 3px; }
.fitting-resolution-inline input { width: 112px; height: 27px; padding: 0 7px; border: 1px solid #ded7c8; border-radius: 7px; font: inherit; font-size: 11px; }
.fitting-resolution-inline button { width: 27px; height: 27px; border: 1px solid #b6d4ba; border-radius: 50%; color: #267143; background: #edf6ed; cursor: pointer; }
.fitting-issue-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px; border-radius: 50%; background: #efe9dc; color: #655b48; font-size: 11px; }
.fitting-deleted-issues { margin: 5px 0; color: #827966; font-size: 12px; }
.fitting-deleted-issues > summary { display: inline-flex; padding: 4px 9px; border: 1px solid #e5dfd3; border-radius: 999px; background: #f7f5f1; cursor: pointer; }
.fitting-deleted-issues .fitting-issue-list { margin-top: 5px; }
.fitting-issue-editor { grid-template-columns: minmax(160px,220px) minmax(180px,1fr) auto auto; grid-column: 1 / -1; padding: 6px; }
.fitting-issue-editor input, .fitting-issue-editor select { height: 32px; padding: 0 9px; font-size: 12px; }
.fitting-issue-form, .product-fitting-add-comment { display: grid; grid-template-columns: minmax(150px,210px) minmax(120px,1fr) auto; align-items: center; gap: 6px; max-width: none; margin-top: 7px; }
.fitting-checklist-list { display: grid; gap: 8px; margin-top: 16px; }
.fitting-checklist-setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.fitting-checklist-setting > div { display: grid; gap: 4px; }
.fitting-checklist-setting small { color: var(--muted); }
.fitting-checklist-setting > span { display: flex; gap: 7px; flex-wrap: wrap; }
.fitting-checklist-editor { margin: 16px 0; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.fitting-checklist-editor .field-row { display: grid; gap: 7px; margin: 12px 0; }
.fitting-checklist-editor input:not([type=checkbox]), .fitting-checklist-editor textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font: inherit; }
.fitting-checklist-edit-block { margin: 12px 0; padding: 14px; border: 1px solid #e8deca; border-radius: 12px; background: #fffdf8; }
.fitting-checklist-edit-block > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.fitting-checklist-edit-block > header label { display: grid; flex: 1; gap: 6px; font-weight: 600; }
.fitting-checklist-edit-block input { min-width: 0; }
.fitting-checklist-edit-items { display: grid; gap: 7px; margin-bottom: 9px; }
.fitting-checklist-edit-item { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 7px; }
.fitting-checklist-edit-item > span { color: var(--muted); text-align: right; }
.fitting-checklist-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.fitting-checklist-categories label { display: flex; gap: 6px; align-items: center; padding: 7px 10px; background: #f7f4ec; border-radius: 999px; }
.fitting-checklist-block { margin: 14px 0; padding: 14px; border: 1px solid #e8deca; border-radius: 12px; background: #fffdf8; }
.fitting-checklist-block > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.fitting-checklist-select { min-width: min(420px, 100%); max-width: 100%; border: 1px solid var(--border); border-radius: 9px; background: white; padding: 8px 10px; font: inherit; }
.fitting-checklist-section { margin-top: 12px; }
.fitting-checklist-section h3 { margin: 12px 0 6px; font-size: 14px; color: #6f1a19; }
.fitting-checklist-entry { display: grid; grid-template-columns: minmax(280px,1fr) minmax(190px,280px) minmax(130px,180px); align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid #eee8dc; }
.fitting-checklist-check { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.fitting-checklist-check input { margin-top: 3px; accent-color: #278249; }
.fitting-checklist-entry.is-ok .fitting-checklist-check span { color: #287344; }
.fitting-checklist-entry input:not([type=checkbox]) { min-width: 0; border: 1px solid #e2d9c8; border-radius: 8px; padding: 8px 9px; background: white; font: inherit; }
.fitting-checklist-entry small { grid-column: 2 / -1; color: var(--muted); }
.fitting-checklist-entry.is-saving { opacity: .55; }
.fitting-checklist-entry.is-saved { background: #f3fbf4; }
.fitting-settings-tabs { display: flex; gap: 8px; margin: 12px 0 20px; border-bottom: 1px solid var(--border); }
.fitting-settings-tabs button { padding: 10px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.fitting-settings-tabs button.active { border-bottom-color: #5b090d; color: #5b090d; font-weight: 700; }
.fitting-checklist-table { width: 100%; min-width: 860px; table-layout: fixed; border-collapse: collapse; background: white; }
.fitting-checklist-table .fit-col-item { width: 26%; }
.fitting-checklist-table .fit-col-choice { width: 5%; }
.fitting-checklist-table .fit-col-comment { width: 49%; }
.fitting-checklist-table .fit-col-area { width: 15%; }
.fitting-checklist-table th { padding: 8px 7px; background: #f3eee4; color: #675e4d; text-align: left; font-size: 12px; }
.fitting-checklist-table td { padding: 7px; border-top: 1px solid #eee8dc; vertical-align: top; }
.fitting-checklist-table th:nth-child(2), .fitting-checklist-table th:nth-child(3), .fitting-checklist-result { text-align: center !important; }
.fitting-checklist-item-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.fitting-checklist-result button { width: 30px; height: 30px; border: 1px solid #ded7c8; border-radius: 8px; background: #fff; color: #756d61; font-size: 18px; cursor: pointer; }
.fitting-checklist-result button[data-result="ok"].active { border-color: #86c99a; background: #e8f6eb; color: #237644; font-weight: 700; }
.fitting-checklist-result button[data-result="issue"].active { border-color: #e0a29a; background: #fff0ee; color: #b13d31; font-weight: 700; }
.fitting-checklist-table textarea, .fitting-checklist-table select { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid #e2d9c8; border-radius: 8px; padding: 8px; background: white; font: inherit; font-size: 13px; }
.fitting-checklist-table textarea { min-height: 60px; resize: vertical; white-space: pre-wrap; }
.fitting-checklist-table select { min-height: 38px; }
.fitting-checklist-entry.has-issue .fitting-checklist-item-text { color: #a53b30; }
.product-fitting-checklist-row.has-issue { color: #a53b30; }
.fitting-legacy-issues { margin-top: 12px; padding: 10px 12px; background: #f7f5f0; border-radius: 9px; }
.product-fitting-checklist { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.product-fitting-checklist-row { display: grid; gap: 3px; padding: 7px; border-top: 1px solid var(--border); }
.product-fitting-checklist-row.is-ok { color: #287344; }
@media (max-width: 760px) { .fitting-checklist-entry { grid-template-columns: 1fr; } .fitting-checklist-entry small { grid-column: auto; } .fitting-checklist-block > header, .fitting-checklist-setting { align-items: flex-start; flex-direction: column; } }
.fitting-detail-heading { margin-bottom: 8px; }
.fitting-detail-heading > .settings-back { margin: 0 0 4px; padding: 3px 0; font-size: 12px; }
.fitting-detail-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fitting-detail-title-row .page-title { margin: 0 8px 0 0; font-size: 22px; }
.fitting-detail-title-row .btn { min-height: 30px; height: 30px; padding: 0 10px; font-size: 12px; }
.fitting-detail-heading .settings-intro { margin: 4px 0 8px; font-size: 12px; }
.fitting-detail-toolbar { gap: 8px; margin: 8px 0 12px; }
.fitting-detail-toolbar .fitting-inline-search { height: 36px; flex-basis: 300px; }
.fitting-detail-toolbar .fitting-view-controls { transform: scale(.92); transform-origin: right center; }
#view-fittings .fitting-product-list { display: flex; flex-direction: column; gap: 0; overflow: hidden; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
#view-fittings .fitting-product-list > .fitting-product-card { flex: 0 0 auto; margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: #fff; }
#view-fittings .fitting-product-list > .fitting-product-card:last-child { border-bottom: 0; }
.fitting-product-list > .fitting-product-card .fitting-product-head { padding: 10px 12px; }
.fitting-product-list > .fitting-product-card .fitting-card-body { padding: 0 12px 12px; }
.fitting-checklist-table .fitting-checklist-entry { display: table-row; padding: 0; border: 0; }
.fitting-checklist-table .fitting-checklist-entry.is-ok .fitting-checklist-item-text { color: #287344; }
.fitting-checklist-table .fitting-checklist-entry.has-issue .fitting-checklist-item-text { color: #a53b30; }
.fitting-checklist-table .fitting-checklist-entry.is-saving { opacity: .6; }
.fitting-checklist-table .fitting-checklist-entry.is-saved td { background-color: #f3fbf4; }
.fitting-checklist-table .fitting-checklist-item-text { width: 26%; }
.fitting-checklist-table .fitting-checklist-result { width: 5%; }
.fitting-checklist-table .fitting-checklist-result button { width: 26px; height: 26px; }
.fitting-checklist-editor { padding: 14px; }
.fitting-checklist-editor h2 { margin: 0 0 12px; font-size: 18px; }
.fitting-checklist-editor .field-row { gap: 5px; margin: 9px 0; font-size: 13px; }
.fitting-checklist-editor .field-row > span, .fitting-checklist-editor .field-row > b { font-size: 13px; font-weight: 650; }
.fitting-checklist-editor .field-row small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.fitting-checklist-editor input:not([type=checkbox]), .fitting-checklist-editor textarea { padding: 8px 10px; font-size: 13px; }
.fitting-checklist-categories { display: grid; grid-template-columns: repeat(auto-fit,minmax(170px,1fr)); gap: 5px 8px; max-height: 190px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.fitting-checklist-categories label { padding: 5px 7px; border-radius: 6px; background: transparent; font-size: 12px; }
.fitting-checklist-categories input { margin: 0; accent-color: #5b090d; }
.fitting-checklist-edit-block { margin: 8px 0; padding: 10px; }
.fitting-checklist-edit-block > header { align-items: end; margin-bottom: 7px; }
.fitting-checklist-edit-block > header label { gap: 4px; font-size: 12px; }
.fitting-checklist-edit-items { gap: 5px; margin-bottom: 6px; }
.fitting-checklist-edit-item { grid-template-columns: 22px minmax(0,1fr) auto; gap: 5px; }
.fitting-checklist-edit-item input { height: 34px; }
.fitting-checklist-edit-item .btn { min-height: 30px; height: 30px; padding: 0 9px; }
.fitting-checklist-edit-block > .btn { min-height: 30px; height: 30px; padding: 0 9px; font-size: 12px; }
.fitting-area-list, .fitting-status-list { display: grid; gap: 6px; }
.fitting-area-row, .fitting-status-row { padding: 7px 9px; border-radius: 8px; font-size: 13px; }
.fitting-area-row .btn, .fitting-status-row .btn { min-height: 30px; height: 30px; padding: 0 9px; font-size: 12px; }
.fitting-area-add, .fitting-status-add { gap: 6px; margin-top: 8px; }
.fitting-area-add input, .fitting-status-add input, .fitting-status-add select { height: 34px; padding: 0 9px; font-size: 13px; }
.fitting-status-add .btn, .fitting-area-add .btn { min-height: 34px; height: 34px; padding: 0 11px; font-size: 12px; }
.fitting-settings-split { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:18px; align-items:start; }
.fitting-settings-split > section { min-width:0; padding:14px; border:1px solid var(--border); border-radius:12px; background:rgba(255,255,255,.52); }
.fitting-settings-split .section-title { margin-top:0; }
.fitting-inline-name { min-width:0; width:100%; padding:3px 2px; border:0; background:transparent; color:var(--text); text-align:left; font:inherit; cursor:text; }
.fitting-inline-name:hover { color:var(--wine); }
.fitting-inline-editor { min-width:0; width:100%; box-sizing:border-box; height:34px; padding:5px 8px; border:1px solid var(--gold); border-radius:7px; background:#fff; font:inherit; }
.fitting-icon-remove { display:inline-grid; place-items:center; flex:none; width:28px; height:28px; border:0; border-radius:50%; background:transparent; color:#9b9283; font-size:20px; line-height:1; cursor:pointer; transition:background .16s,color .16s,transform .16s; }
.fitting-icon-remove:hover { background:#f8e8e5; color:#a63a2d; transform:scale(1.06); }
.fitting-checklist-setting { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:0 8px; padding:0; overflow:hidden; }
.fitting-checklist-summary { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:2px 12px; width:100%; min-height:52px; padding:9px 12px; border:0; background:transparent; color:var(--text); text-align:left; font:inherit; cursor:pointer; }
.fitting-checklist-summary b { min-width:0; }
.fitting-checklist-summary small { grid-column:1; }
.fitting-checklist-summary .fitting-checklist-chevron { grid-column:2; grid-row:1/3; color:#8a806e; transition:transform .18s; }
.fitting-checklist-summary[aria-expanded="true"] .fitting-checklist-chevron { transform:rotate(180deg); }
.fitting-checklist-setting > .fitting-icon-remove { align-self:center; margin-right:8px; }
.fitting-add-line { display:inline-grid; place-items:center; width:28px; height:28px; border:1px solid var(--border); border-radius:50%; background:#fff; color:var(--wine); font-size:18px; cursor:pointer; }
.fitting-add-line:hover { border-color:var(--wine); background:#fbf5f0; }
.fitting-checklist-edit-block { border:0; border-bottom:1px solid #eee9de; border-radius:0; background:transparent; padding:8px 2px; }
.fitting-checklist-edit-block:last-child { border-bottom:0; }
.fitting-checklist-edit-items { gap:2px; }
.fitting-checklist-edit-item input { border-color:transparent !important; border-bottom-color:#e9e4d9 !important; border-radius:0 !important; background:transparent; }
@media(max-width:760px){.fitting-settings-split{grid-template-columns:1fr}.fitting-settings-split>section{padding:10px}}
@media (max-width: 760px) {
  .fitting-detail-title-row { align-items: flex-start; }
  .fitting-detail-title-row .page-title { flex-basis: 100%; }
  .fitting-checklist-table { min-width: 760px; }
}
.fitting-checklist-block { margin: 9px 0; padding: 9px 10px; }
.fitting-checklist-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: 13px; }
.fitting-checklist-toolbar .fitting-checklist-select { width: min(360px, 55%); min-width: 180px; padding: 6px 9px; font-size: 12px; }
.fitting-checklist-details { border-top: 1px solid #e8deca; }
.fitting-checklist-details > summary { display: flex; align-items: center; gap: 12px; padding: 7px 2px; color: #635a4b; font-size: 12px; font-weight: 650; cursor: pointer; list-style-position: inside; }
.fitting-checklist-summary { justify-content: space-between; }
.fitting-checklist-summary > span { display: flex; align-items: baseline; gap: 10px; }
.fitting-checklist-summary > span > b { color: var(--text); font-size: 13px; }
.fitting-checklist-fold-hint::before { content: 'Нажмите, чтобы свернуть'; color: var(--muted); font-size: 11px; font-weight: 500; }
.fitting-checklist-details:not([open]) .fitting-checklist-fold-hint::before { content: 'Нажмите, чтобы раскрыть'; }
.fitting-checklist-details > summary small { color: var(--muted); font-weight: 500; }
.fitting-checklist-details > summary i { font-style: normal; }
.fitting-count-ok { color: #287344; }
.fitting-count-issue { color: #a53b30; }
.fitting-checklist-content { padding-top: 2px; }
.fitting-checklist-carry { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 7px; padding: 6px 8px; border: 1px solid #e8deca; border-radius: 7px; background: #faf8f2; color: #635a4b; font-size: 11px; }
.fitting-checklist-carry small { color: #287344; white-space: nowrap; }
.fitting-checklist-section { margin-top: 3px; }
.fitting-checklist-section h3 { margin: 6px 0 4px; font-size: 12px; }
.fitting-checklist-table { min-width: 920px; }
.fitting-checklist-table .fit-col-item { width: 26%; }
.fitting-checklist-table .fit-col-choice { width: 94px; }
.fitting-checklist-table .fit-col-comment { width: 48%; }
.fitting-checklist-table .fit-col-area { width: 20%; }
.fitting-checklist-table th { padding: 6px 8px; }
.fitting-checklist-table td { padding: 4px 7px; vertical-align: middle; }
.fitting-checklist-table .fitting-checklist-entry { display: table-row; }
.fitting-checklist-table .fitting-checklist-entry.is-ok td { background: #eaf5eb; }
.fitting-checklist-table .fitting-checklist-entry.has-issue td { background: #fae9e7; }
.fitting-checklist-table .fitting-checklist-entry.is-ok:hover td { background: #e1f0e3; }
.fitting-checklist-table .fitting-checklist-entry.has-issue:hover td { background: #f6ddda; }
.fitting-checklist-table .fitting-checklist-entry.is-saving { opacity: .58; }
.fitting-checklist-table .fitting-checklist-item-text { font-size: 12px; }
.fitting-checklist-decisions { display: inline-flex; gap: 4px; }
.fitting-checklist-table .fitting-checklist-result button { width: 25px; height: 25px; font-size: 15px; }
.fitting-checklist-table textarea, .fitting-checklist-table select { padding: 5px 7px; font-size: 12px; }
.fitting-checklist-table textarea { min-height: 38px; height: 38px; resize: vertical; }
.fitting-checklist-table select { min-height: 32px; }
.fitting-responsibility-picker { display: grid; gap: 4px; min-width: 145px; }
.fitting-responsibility-picker select { min-height: 29px; padding: 4px 6px; font-size: 11px; }
.fitting-product-list { overflow: visible; }
.fitting-product-list > .fitting-product-card { position: relative; }
.fitting-product-list > .fitting-product-card:has(.fitting-cover:hover) { z-index: 5; }
.fitting-checklist-panel > .fitting-checklist-content { padding: 10px 12px 12px; }
.fitting-checklist-panel > summary { flex-wrap: wrap; }
.fitting-checklist-panel > summary small { color: #817967; font-size: 11px; font-weight: 500; }
.fitting-checklist-table .fitting-checklist-entry.is-carried-forward td { background-color: #f3f2ee; color: #6c685f; }
.fitting-checklist-table .fitting-checklist-entry.is-carried-forward .fitting-checklist-comment { background: #f8f7f4; }
.fitting-entry-history { margin-top: 5px; font-size: 11px; }
.fitting-entry-history > summary { color: #786f5e; cursor: pointer; list-style: none; }
.fitting-entry-history > summary::-webkit-details-marker { display: none; }
.fitting-entry-history > summary::before { content: '›'; display: inline-block; width: 13px; font-size: 16px; transition: transform .15s ease; }
.fitting-entry-history[open] > summary::before { transform: rotate(90deg); }
.fitting-entry-history > div { display: grid; gap: 4px; margin-top: 5px; }
.fitting-checklist-history-change { padding: 6px 8px; border-left: 2px solid #c8b98f; background: #f8f6f0; }
.fitting-checklist-history-change > small { display: block; margin-bottom: 3px; color: #817967; }
.fitting-checklist-history-change > div { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fitting-history-before { color: #898477; text-decoration: line-through; }
.product-fitting-checklist-table { min-width: 920px; table-layout: fixed; }
.fitting-checklist-list { gap: 5px; margin-top: 10px; }
.fitting-checklist-setting { padding: 8px 10px; border-radius: 9px; }
.fitting-checklist-setting > div { min-width: 0; gap: 2px; }
.fitting-checklist-setting small { font-size: 11px; line-height: 1.35; }
.fitting-checklist-editor { margin: 9px 0; padding: 12px; border-radius: 10px; }
.fitting-checklist-editor .field-row { gap: 4px; margin: 8px 0; }
.fitting-checklist-category-field { padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #faf8f2; }
.fitting-checklist-category-field small { max-width: 900px; }
.fitting-checklist-categories { grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 3px 5px; max-height: 150px; padding: 5px; }
.fitting-checklist-categories label { min-height: 27px; padding: 3px 6px; border: 1px solid #ece6d9; background: #fff; font-size: 11px; }
.fitting-checklist-categories label.is-child { padding-left: 12px; }
.fitting-checklist-edit-block { margin: 6px 0; padding: 8px; border-radius: 8px; }
.fitting-checklist-edit-block > header { gap: 7px; margin-bottom: 5px; }
.fitting-checklist-edit-items { gap: 3px; margin-bottom: 4px; }
.fitting-checklist-edit-item input { height: 31px; padding: 5px 8px; }
.fitting-checklist-edit-block .btn, .fitting-checklist-editor .actions-row .btn { min-height: 29px; height: 29px; padding: 0 8px; font-size: 11px; }

/* Compact product analytics, inheriting each user's selected CRM fonts. */
.analytics-overview-grid { display:grid; grid-template-columns:minmax(0, 1.65fr) minmax(220px, .85fr); gap:10px; align-items:start; margin-bottom:10px; }
.analytics-overview-grid > * { min-width:0; }
.analytics-country-wrap .kpi-countries-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(255px,1fr)); gap:8px; margin:0; }
.analytics-country-wrap .kpi-country-col { min-width:0; padding:7px 8px; border-radius:8px; }
.analytics-country-wrap .kpi-country-name { margin-bottom:5px; font-size:10px; }
.analytics-country-wrap .kpi-country-col .kpi-row { gap:5px; margin-bottom:5px; }
.analytics-country-wrap .kpi-cell { min-width:0; padding:5px 7px; border-radius:7px; }
.analytics-country-wrap .kpi-cell label { font-size:10px; }
.analytics-country-wrap .kpi-value-input { font-size:13px; }
.analytics-country-wrap .kpi-unit { font-size:12px; }
.analytics-country-wrap .kpi-material-sub { font-size:9px; }
.analytics-country-wrap .kpi-econ { gap:4px; padding:5px 6px; }
.analytics-country-wrap .kpi-econ-i { font-size:10px; }
.analytics-competitor-note-wrap .analytics-note-box { height:100%; min-height:100px; margin:0; padding:9px 10px; }
.analytics-competitor-note-wrap .analytics-note-label { margin-bottom:4px; font-size:11px; }
.analytics-competitor-note-wrap textarea, .analytics-competitor-note-wrap input { min-height:56px; padding:7px 8px; font-size:12px; font-family:var(--crm-font-body, inherit); }
.niche-analysis-block { padding:9px 10px; border-radius:10px; }
.niche-analysis-block > summary.section-title { display:inline-flex; align-items:center; min-height:32px; margin:0; padding:5px 12px; border:1px solid var(--border); border-radius:999px; background:var(--white); color:var(--ink); font-size:12px; font-weight:650; cursor:pointer; list-style:none; transition:background .16s,border-color .16s,transform .16s; }
.niche-analysis-block > summary.section-title::-webkit-details-marker { display:none; }
.niche-analysis-block > summary.section-title:hover { border-color:var(--gold); background:#faf8f2; transform:translateY(-1px); }
.niche-analysis-block[open] > summary.section-title { margin-bottom:8px; background:var(--cream); }
.niche-analysis-block > summary.section-title::marker { color:var(--gold); }
.suppliers-table, .suppliers-table input, .suppliers-table select, .suppliers-table button { font-family:var(--crm-font-body, 'Roboto',system-ui,sans-serif); }
.suppliers-table th, .suppliers-table td { font-family:var(--crm-font-body, 'Roboto',system-ui,sans-serif); }
.fitting-checklist-setting { min-height:0; }
.fitting-checklist-summary { min-height:42px; grid-template-columns:minmax(0,1fr) auto; gap:1px 8px; padding:6px 9px; }
.fitting-checklist-summary b { font-size:13px; }
.fitting-checklist-summary small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.fitting-checklist-category-field { display:grid; gap:6px; padding:7px 9px; border:1px solid var(--border); border-radius:8px; background:#faf8f2; }
.fitting-checklist-category-field > summary { display:flex; align-items:center; justify-content:space-between; gap:8px; cursor:pointer; list-style:none; font-size:12px; }
.fitting-checklist-category-field > summary::-webkit-details-marker { display:none; }
.fitting-checklist-category-field > summary::after { content:'⌄'; color:var(--gold); transition:transform .16s; }
.fitting-checklist-category-field[open] > summary::after { transform:rotate(180deg); }
.fitting-checklist-category-field > small { color:var(--muted); font-size:10px; line-height:1.35; }
.fitting-checklist-editor .fitting-checklist-edit-block { padding:5px 2px; margin:4px 0; }
.fitting-checklist-editor .fitting-checklist-edit-block > header label { display:grid; grid-template-columns:auto minmax(150px,1fr); align-items:center; gap:7px; }
.fitting-checklist-editor .fitting-checklist-edit-block > header input { height:29px; padding:4px 7px; }
.fitting-checklist-editor .fitting-checklist-edit-item input { height:28px; padding:3px 7px; font-size:12px; }
.fitting-checklist-editor .fitting-checklist-edit-items { gap:0; }
.fitting-checklist-table .fitting-checklist-entry.is-saving td { transition:background-color .12s ease; }
@media(max-width:900px){.analytics-overview-grid{grid-template-columns:1fr}.analytics-country-wrap .kpi-countries-row{grid-template-columns:repeat(auto-fit,minmax(230px,1fr));}}

/* Targeted compact analytics and fitting polish. */
.analytics-country-wrap .kpi-countries-row { grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:6px; }
.analytics-country-wrap .kpi-country-col { padding:6px 7px; }
.analytics-country-wrap .kpi-country-name { margin-bottom:3px; font-size:10px; }
.analytics-country-wrap .kpi-country-col .kpi-row { gap:4px; margin-bottom:3px; }
.analytics-country-wrap .kpi-cell { padding:4px 5px; }
.analytics-country-wrap .kpi-cell-head { gap:3px; }
.analytics-country-wrap .kpi-cell label { font-size:9px; line-height:1.2; }
.analytics-country-wrap .kpi-value-input { height:25px; padding:2px 4px; font-size:12px; }
.analytics-country-wrap .kpi-unit { font-size:10px; }
.analytics-country-wrap .kpi-econ { gap:3px; padding:4px 5px; font-size:10px; }
.analytics-insights-area { display:grid; gap:8px; margin-top:12px; }
.analytics-insights-area .niche-analysis-block { margin:0 !important; padding:7px 8px; }
.analytics-insights-area .niche-analysis-block > summary.section-title { min-height:29px; padding:4px 10px; font-family:var(--crm-font-body,inherit); }
.niche-item { margin:6px 0; border:1px solid var(--border); border-radius:9px; background:var(--white); overflow:visible; }
.niche-item > summary { display:flex; align-items:center; gap:8px; min-height:34px; padding:5px 9px; border-radius:9px; font-size:12px; font-weight:650; cursor:pointer; list-style:none; transition:background .16s,border-color .16s,box-shadow .16s; }
.niche-item > summary::-webkit-details-marker { display:none; }
.niche-item > summary::after { content:'⌄'; margin-left:auto; color:var(--muted); transition:transform .16s; }
.niche-item > summary:hover { background:#faf8f2; }
.niche-item[open] > summary { border-bottom:1px solid var(--border); border-radius:9px 9px 0 0; background:#f7f3e9; }
.niche-item[open] > summary::after { transform:rotate(180deg); }
.niche-item-updated { margin-left:auto; font-size:10px; font-weight:450; }
.niche-result-tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:6px; margin:8px 0; }
.niche-result-tile { min-width:0; align-self:start; border:1px solid var(--border); border-radius:8px; background:var(--white); overflow:visible; }
.niche-result-tile > summary { display:flex; align-items:center; gap:8px; min-height:34px; padding:5px 9px; border-radius:8px; color:var(--ink); font-size:11px; font-weight:650; cursor:pointer; list-style:none; transition:background .16s,border-color .16s,color .16s; }
.niche-result-tile > summary::-webkit-details-marker { display:none; }
.niche-result-tile > summary::after { content:'⌄'; margin-left:auto; color:var(--muted); transition:transform .16s; }
.niche-result-tile > summary:hover { background:#faf8f2; color:var(--wine); }
.niche-result-tile[open] > summary { border-bottom:1px solid var(--border); border-radius:8px 8px 0 0; background:#f3eee3; color:var(--wine); }
.niche-result-tile[open] > summary::after { transform:rotate(180deg); }
.niche-result-tile > summary small { color:var(--muted); font-size:9px; font-weight:500; }
.niche-result-content { padding:7px; }
.niche-result-content > .muted { margin:2px 0 7px !important; line-height:1.4; }
.niche-result-content .niche-subtitle { margin:5px 0; }
.analytics-recommendations-card { padding:12px 14px; border:1px solid var(--border); border-radius:11px; background:var(--white); font-family:var(--crm-font-body,inherit); }
.analytics-recommendations-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.analytics-recommendations-head h3 { margin:0; color:var(--wine); font-size:15px; font-family:var(--crm-font-heading,var(--crm-font-body,inherit)); }
.analytics-recommendations-head small { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.analytics-recommendations-content { margin-top:9px; padding:9px 10px; border-radius:8px; background:var(--cream); line-height:1.5; font-size:12px; white-space:normal; overflow-wrap:anywhere; }
.analytics-recommendations-empty { display:flex; align-items:center; gap:10px; margin-top:9px; padding:10px; border:1px dashed var(--border); border-radius:8px; background:#fbfaf7; }
.analytics-recommendations-empty > span { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#f1eadb; color:var(--gold); }
.analytics-recommendations-empty b,.analytics-recommendations-empty small { display:block; }
.analytics-recommendations-empty b { font-size:12px; }
.analytics-recommendations-empty small { margin-top:2px; color:var(--muted); font-size:11px; }
.fitting-entry-history { position:relative; display:inline-block; margin:0 0 0 5px; vertical-align:middle; font-size:10px; }
.fitting-entry-history > summary { display:inline-grid; place-items:center; min-width:20px; height:20px; padding:0 4px; border:1px solid transparent; border-radius:50%; color:#8a806d; cursor:pointer; list-style:none; transition:background .16s,border-color .16s,color .16s; }
.fitting-entry-history > summary::-webkit-details-marker,.fitting-entry-history > summary::before { display:none !important; }
.fitting-entry-history > summary:hover,.fitting-entry-history[open] > summary { border-color:var(--border); background:var(--white); color:var(--wine); }
.fitting-entry-history > summary span { position:absolute; top:-3px; right:-3px; display:grid; place-items:center; min-width:11px; height:11px; padding:0 2px; border-radius:8px; background:var(--gold); color:#fff; font-size:8px; line-height:1; }
.fitting-entry-history > div { position:absolute; z-index:45; top:calc(100% + 5px); left:0; width:min(360px,70vw); max-height:190px; overflow:auto; padding:6px; border:1px solid var(--border); border-radius:8px; background:var(--white); box-shadow:0 8px 22px rgba(30,24,13,.16); }
.fitting-area-select { position:relative; min-width:0; }
.fitting-status-row:focus-within { position:relative; z-index:3; }
.fitting-area-select.is-open { z-index:7; }
.fitting-area-select-trigger { display:flex; align-items:center; justify-content:space-between; gap:8px; width:100%; min-height:34px; padding:6px 9px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; font-size:12px; text-align:left; cursor:pointer; transition:border-color .16s,box-shadow .16s,background .16s; }
.fitting-area-select-trigger:hover,.fitting-area-select.is-open .fitting-area-select-trigger { border-color:var(--gold); background:#fcfbf8; }
.fitting-area-select-trigger:focus-visible { outline:2px solid #a7864e; outline-offset:2px; }
.fitting-area-select-trigger span { color:var(--muted); transition:transform .16s; }
.fitting-area-select.is-open .fitting-area-select-trigger span { transform:rotate(180deg); }
.fitting-area-select-menu { position:absolute; z-index:1000; top:calc(100% + 4px); left:0; right:0; max-height:220px; overflow:auto; padding:4px; border:1px solid var(--border); border-radius:9px; background:var(--white); box-shadow:0 10px 26px rgba(28,23,15,.18); }
.fitting-area-select-menu[hidden] { display:none; }
.fitting-area-select-menu button { display:block; width:100%; padding:7px 8px; border:0; border-radius:6px; background:transparent; color:var(--ink); font:inherit; font-size:12px; text-align:left; cursor:pointer; }
.fitting-area-select-menu button:hover { background:#f7f3e9; }
.fitting-area-select-menu button[aria-selected="true"] { background:#eee5d2; color:var(--wine); font-weight:650; }
.fitting-detail-skeleton { display:grid; gap:12px; padding:20px; }
.fitting-detail-skeleton span { display:block; height:48px; border-radius:10px; background:linear-gradient(90deg,#eeeae1 25%,#f8f6f1 42%,#eeeae1 65%); background-size:300% 100%; animation:fitting-skeleton-shimmer 1.15s ease-in-out infinite; }
.fitting-detail-skeleton span:first-child { height:88px; }
@keyframes fitting-skeleton-shimmer { to { background-position:-150% 0; } }
@media(prefers-reduced-motion:reduce){.fitting-detail-skeleton span{animation:none}.fitting-area-select-trigger,.fitting-area-select-trigger span,.fitting-area-select-menu button,.niche-item > summary,.niche-item > summary::after,.niche-result-tile > summary,.niche-result-tile > summary::after{transition:none}}
.cat-row { grid-template-columns: minmax(190px,1fr) 70px minmax(310px,1.5fr); gap: 10px; padding: 9px 12px; }
.cat-child-row { background: #fcfbf8; }
.cat-name { min-width: 0; display: grid; gap: 1px; }
.cat-name-edit { width: fit-content; max-width: 100%; padding: 1px 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.cat-name-edit:hover { color: #6f1a19; text-decoration: underline; text-underline-offset: 2px; }
.cat-name-edit span { color: #a18b65; }
.cat-name small { color: var(--muted); font-size: 10px; }
.cat-name-child { padding-left: 14px; }
.cat-actions { gap: 5px; align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.cat-actions .btn { min-height: 29px; height: 29px; padding: 0 9px; font-size: 11px; white-space: nowrap; }
.cat-mpstats-advanced { margin-top: 3px; font-size: 10px; font-weight: 500; }
.cat-mpstats-advanced > summary { color: var(--muted); cursor: pointer; }
.cat-mpstats-advanced .cat-niche { margin-top: 4px; }
.cat-child-inline-form { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; padding: 7px; border-radius: 7px; background: #f7f4ec; }
.cat-child-inline-form[hidden] { display: none; }
.cat-child-inline-form input, .cat-inline-edit input, .cat-inline-edit select { min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; font-size: 12px; }
.cat-child-inline-form input { flex: 1; }
.cat-inline-edit { display: grid; grid-template-columns: minmax(130px,1fr) minmax(130px,1fr) auto; gap: 5px; }
.cat-inline-edit > div { display: flex; gap: 4px; }
.category-create-panel { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: #faf8f2; }
.category-create-panel > b { font-size: 13px; }
.category-create-panel > small { color: var(--muted); font-size: 11px; }
.category-create-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.category-create-row input, .category-create-row select { flex: 1; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; background: #fff; font: inherit; font-size: 12px; }
.category-create-row .btn { min-height: 34px; height: 34px; padding: 0 10px; font-size: 12px; }
.category-composition-settings { margin: 12px 0 16px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.category-composition-settings > summary { color: var(--ink); font-size: 14px; font-weight: 650; cursor: pointer; }
.category-composition-settings > p { margin: 7px 0 10px; font-size: 11px; }
.category-composition-card { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fcfbf8; }
.category-composition-card > header { margin-bottom: 6px; }
.category-composition-type { margin: 5px 0; padding: 7px; border: 1px solid #ece6d9; border-radius: 7px; background: #fff; }
.category-composition-type-head, .category-composition-create { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.category-composition-type-head input, .category-composition-create input, .category-composition-type select { min-width: 180px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; font: inherit; font-size: 11px; }
.category-composition-type-head input { flex: 1; }
.category-composition-components { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.category-composition-components > span { padding: 3px 7px; border-radius: 99px; background: #f3efe5; font-size: 11px; }
.category-composition-components button { border: 0; background: none; color: #a53b30; cursor: pointer; }
.category-composition-type select { width: 100%; }
.category-composition-create { margin-top: 8px; }
.category-composition-create input { flex: 1; }
@media (max-width: 760px) {
  .fitting-checklist-toolbar { align-items: stretch; flex-direction: column; }
  .fitting-checklist-toolbar .fitting-checklist-select { width: 100%; }
  .cat-row { grid-template-columns: minmax(0,1fr) auto; }
  .cat-row > .cat-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .cat-inline-edit { grid-template-columns: 1fr; }
  .cat-child-inline-form, .category-create-row { align-items: stretch; flex-direction: column; }
  .fitting-checklist-details > summary { align-items: flex-start; flex-direction: column; gap: 3px; }
  .fitting-checklist-carry { align-items: flex-start; flex-direction: column; }
}
.fitting-issue-form input, .product-fitting-add-comment input { min-width: 0; width: 100%; height: 34px; box-sizing: border-box; padding: 0 10px; border: 1px solid #ded7c8; border-radius: 8px; background: #fff; font: inherit; font-size: 12px; }
.fitting-issue-form select, .product-fitting-add-comment select { min-width: 0; height: 34px; padding: 0 8px; border: 1px solid #ded7c8; border-radius: 8px; background: #fff; font: inherit; font-size: 12px; }
.fitting-issue-form .btn, .product-fitting-add-comment .btn { min-height: 34px; white-space: nowrap; }
.product-fitting-entry { padding: 10px 12px; }
.product-fitting-checklist-table-wrap { overflow-x: auto; }
.product-fitting-checklist-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 12px; }
.product-fitting-checklist-table th, .product-fitting-checklist-table td { padding: 6px 8px; border-bottom: 1px solid #e8deca; text-align: left; vertical-align: middle; }
.product-fitting-checklist-table th { background: #f4f0e7; color: #635a4b; font-weight: 650; }
.product-fitting-checklist-table th:nth-child(1) { width: 28%; }
.product-fitting-checklist-table th:nth-child(2) { width: 110px; }
.product-fitting-checklist-table th:nth-child(3) { width: 42%; }
.product-fitting-checklist-table textarea, .product-fitting-checklist-table select { width: 100%; box-sizing: border-box; min-height: 32px; border: 1px solid #ded7c8; border-radius: 7px; background: #fff; padding: 5px 7px; font: inherit; font-size: 12px; }
.product-fitting-checklist-table textarea { resize: vertical; }
.product-fitting-checklist-table tr.is-ok td { background: #eaf5eb; }
.product-fitting-checklist-table tr.has-issue td { background: #fae9e7; }
.product-fit-check-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.product-fitting-issue { margin: 4px 0; padding: 0; border: 0; background: transparent; }
.product-fitting-issue > p { display: none; }
.product-fitting-issue .fitting-issue-row { width: 100%; box-sizing: border-box; }
.fitting-additional-content { display: grid; gap: 9px; padding: 0 12px 12px; }
.fitting-additional-list { display: grid; gap: 6px; }
.fitting-additional-comment { padding: 8px 10px; border: 1px solid #ece4d7; border-radius: 7px; background: #fff; }
.fitting-additional-comment p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fitting-additional-comment small { color: #817968; font-size: 11px; }
.fitting-additional-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 8px; }
.fitting-additional-form textarea { width: 100%; min-height: 42px; box-sizing: border-box; padding: 8px 10px; border: 1px solid #ded7c8; border-radius: 8px; background: #fff; font: inherit; font-size: 13px; resize: vertical; }
.fitting-additional-form .btn { min-height: 36px; white-space: nowrap; }
.fitting-checklist-toolbar .fitting-copy-checklist { flex: 0 0 auto; }
.fitting-history-additional { margin: 8px 0; padding: 8px 10px; border-radius: 7px; background: #f6f2e9; }
.fitting-history-additional p { margin: 5px 0 0; }
.fitting-history-additional small { color: #817968; }
.tasks-page { width: 100%; max-width: none; }
.tasks-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tasks-heading .page-title { margin: 0; }
.tasks-total { padding: 6px 11px; border-radius: 999px; background: #f1ede5; color: #665c4d; font-size: 12px; font-weight: 700; }
.tasks-tabs { display: flex; gap: 6px; margin: 12px 0; padding: 4px; width: fit-content; border: 1px solid #e5dece; border-radius: 999px; background: #fff; }
.tasks-tabs button { border: 0; border-radius: 999px; padding: 8px 16px; background: transparent; color: #655e51; font: inherit; cursor: pointer; }
.tasks-tabs button.active { background: #171717; color: #fff; }
.tasks-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; padding: 12px; border: 1px solid #e7dfd0; border-radius: 10px; background: #faf8f3; }
.tasks-filters label, .task-close-form label { display: grid; gap: 4px; color: #776f60; font-size: 12px; }
.tasks-filters select, .tasks-filters input, .task-close-form select, .task-close-form textarea { min-height: 36px; box-sizing: border-box; padding: 7px 10px; border: 1px solid #ded7c8; border-radius: 7px; background: #fff; color: #25231f; font: inherit; }
.tasks-list { display: grid; gap: 10px; }
.task-card { padding: 13px 15px; border: 1px solid #ded7c8; border-left: 4px solid #a68a58; border-radius: 10px; background: #fff; }
.task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #817968; font-size: 11px; }
.task-card h2 { margin: 8px 0; font-size: 17px; }
.task-status-pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.task-active { background: #f5ead3; color: #745821; }
.task-completed { background: #e5f3e8; color: #246b3c; }
.task-not-completed { background: #fae6e4; color: #a33d34; }
.task-not-relevant { background: #fff0d8; color: #8c5f19; }
.task-card.task-completed { border-left-color: #45815b; }
.task-card.task-not-completed { border-left-color: #b84b42; }
.task-card.task-not-relevant { border-left-color: #c28b35; }
.task-card-meta { display: flex; flex-wrap: wrap; gap: 5px 18px; color: #6f685b; font-size: 12px; }
.task-card-meta a, .task-source-links a { color: #6d0f1a; text-decoration: none; }
.task-source-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 7px; font-size: 12px; }
.task-close-form { display: grid; grid-template-columns: minmax(140px,190px) minmax(220px,1fr) auto; align-items: end; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #eee8dd; }
.task-close-form textarea { min-height: 38px; resize: vertical; }
.task-close-form .btn { min-height: 36px; }
.task-resolution { display: grid; gap: 4px; margin-top: 10px; padding: 8px 10px; border-radius: 7px; background: rgba(255,255,255,.75); font-size: 13px; }
.task-resolution small { color: #817968; }
.task-source-state { display: block; margin-top: 5px; padding: 4px 7px; border-radius: 6px; font-size: 11px; line-height: 1.4; }
.fitting-additional-form { grid-template-columns: minmax(220px,1fr) minmax(180px,260px) auto; }
.fitting-additional-form select { width: 100%; min-width: 0; min-height: 36px; box-sizing: border-box; padding: 6px 9px; border: 1px solid #ded7c8; border-radius: 8px; background: #fff; font: inherit; font-size: 12px; }
.fitting-additional-form { grid-template-columns:minmax(220px,1fr) minmax(220px,310px) auto; }
.fitting-extra-zone { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; min-width:0; }
.fitting-extra-zone > .fitting-responsibility-link { justify-self:start; min-height:34px; padding:5px 9px; }
.fitting-extra-zone .fitting-responsibility-search { grid-column:auto; }
.fitting-checklist-comment + .task-source-state { margin-bottom: 4px; }
@media (max-width: 1050px) {
  .fitting-product-head { grid-template-columns: minmax(0,1fr) auto 24px; }
  .fitting-meta { grid-column: 1; grid-row: 2; text-align: left; }
  .fitting-product-head [data-fit-remove], .fitting-product-head [data-fit-restore] { grid-column: 2; grid-row: 1; }
  .fitting-collapse-arrow { grid-column: 3; grid-row: 1; }
  .fitting-issue-row, .fitting-issue-row.deleted { grid-template-columns: minmax(100px,160px) minmax(120px,1fr) auto; }
  .fitting-issue-row > small { grid-column: 1 / 3; grid-row: 2; }
  .fitting-issue-row .fitting-issue-actions, .fitting-issue-row > .fitting-issue-deleted-tag { grid-column: 3; grid-row: 1 / 3; }
}
@media (max-width: 700px) {
  .fitting-product-head { grid-template-columns: minmax(0,1fr) auto 22px; }
  .fitting-product-head [data-fit-remove], .fitting-product-head [data-fit-restore] { grid-column: 2; }
  .fitting-issue-row, .fitting-issue-row.deleted { grid-template-columns: 1fr auto; gap: 4px 8px; }
  .fitting-issue-row .fitting-issue-status, .fitting-issue-row .fitting-issue-comment { grid-column: 1 / -1; }
  .fitting-issue-row > small { grid-column: 1; grid-row: auto; }
  .fitting-issue-row .fitting-issue-actions { grid-column: 2; grid-row: auto; }
  .fitting-issue-form, .product-fitting-add-comment { grid-template-columns: 1fr; }
  .fitting-additional-form { grid-template-columns: 1fr; }
  .task-close-form { grid-template-columns: 1fr; }
  .tasks-filters { display: grid; grid-template-columns: 1fr; }
  .fitting-issue-editor { grid-template-columns: 1fr 1fr; }
  .fitting-products-toolbar .search-pill { flex: 1 1 100%; max-width: none; }
}
.product-tabs button[draggable="true"] { display: inline-flex; align-items: center; gap: 8px; cursor: grab; }
.product-tabs button[draggable="true"]:active { cursor: grabbing; }
.product-tabs button.fixed-last { cursor: default; }
.product-tabs button.dragging { opacity: .45; }
.product-tabs button.drag-over { outline: 2px dashed var(--gold); outline-offset: 1px; }
.product-tab-drag-handle { color: #a59b86; font-size: 15px; line-height: 1; }
.fitting-issue-summary { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; vertical-align: middle; font-size: 11px; font-weight: 600; white-space: nowrap; }
.fitting-issue-summary > * { padding: 2px 7px; border-radius: 999px; background: #f1ede5; color: #645b4b; }
.fitting-issue-summary .resolved { background: #e7f3e8; color: #287344; }
.fitting-issue-summary .open { background: #fae9e6; color: #a64235; }
.fitting-meta .fitting-issue-summary { display: flex; margin: 5px 0 0; justify-content: flex-end; }
.product-fitting-entry > header .fitting-issue-summary { margin-left: auto; }
.fitting-issue-editor[hidden], .fitting-resolution-inline[hidden], .fitting-icon-action[hidden] { display: none !important; }
.fitting-resolution-inline { display: inline-flex; align-items: center; gap: 4px; }
.fitting-resolution-inline input { width: 140px; }
.fitting-icon-action.resolve { border-color: #b6d4ba; color: #267143; background: #edf6ed; }
.fitting-icon-action.resolve:hover { background: #dcefe0; }
@media (max-width: 700px) { .product-fitting-entry > header .fitting-issue-summary { margin-left: 0; } .fitting-meta .fitting-issue-summary { justify-content: flex-start; } }

/* Personal settings display and shared CRM brand controls */
.settings-personal-view { display:flex; align-items:center; gap:6px; margin:10px 0; color:#746c5e; font-size:12px; }
.settings-personal-view button,.tasks-size-switch button { border:1px solid var(--border); border-radius:999px; background:var(--white); color:var(--ink); padding:5px 10px; cursor:pointer; font:inherit; }
.settings-personal-view button.active,.tasks-size-switch button.active { background:var(--ink); color:var(--white); }
.settings-personal-view label { display:flex; align-items:center; gap:5px; margin-left:8px; }
.settings-tiles-list { display:flex; flex-direction:column; gap:5px; margin:12px 0; }
.settings-tiles-list .settings-tile { min-height:0; padding:9px 12px; flex-direction:row; text-align:left; justify-content:flex-start; gap:10px; border-color:var(--border); box-shadow:none; }
.settings-tiles-list .tile-icon { font-size:17px; }
.settings-tiles-list .tile-desc { margin-left:auto; text-align:right; }
.settings-hide-icons .tile-icon { display:none; }
.crm-style-panel { padding:18px; border:1px solid var(--border); border-radius:12px; background:var(--white); }
.crm-style-panel h3 { margin:22px 0 10px; color:var(--wine); }
.crm-style-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.crm-style-grid label { display:grid; gap:6px; padding:10px; border:1px solid var(--border); border-radius:8px; font-size:13px; }
.crm-style-grid label span { display:flex; align-items:center; gap:10px; }
.crm-style-grid input[type=color] { width:42px; height:34px; border:0; padding:0; background:transparent; cursor:pointer; }
.crm-logo-upload { display:flex; align-items:center; gap:12px; margin:14px 0 7px; font-size:13px; }
.crm-logo-upload input { max-width:260px; }
.crm-style-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px; align-items:end; margin:10px 0 18px; }
.crm-style-options label { display:grid; gap:6px; font-size:13px; }
.crm-style-options select { width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; }
.crm-style-preview { display:flex; min-height:100px; gap:12px; margin:18px 0; padding:12px; border-radius:9px; background:var(--crm-page); }
.crm-style-preview aside { width:180px; padding:15px 10px; border-radius:7px; background:var(--crm-menu); color:#fff; font-weight:700; font-family:var(--crm-heading-font); }
.crm-style-preview[data-menu-style="compact"] aside { padding:8px; border-radius:3px; }
.crm-style-preview[data-menu-style="outlined"] aside { border:1px solid var(--crm-gold); background:transparent; color:var(--crm-menu); }
.crm-style-preview[data-menu-style="pill"] aside { border-radius:24px; }
.crm-style-preview[data-menu-text="bold"] aside { font-weight:800; }
.crm-style-preview[data-menu-text="uppercase"] aside { text-transform:uppercase; letter-spacing:.06em; }
.crm-style-preview > div { flex:1; padding:15px; border-radius:7px; background:var(--crm-card); color:var(--crm-text); font-family:var(--crm-body-font); }
.crm-style-preview h2 { font:700 18px var(--crm-heading-font); color:var(--crm-text); }
.crm-style-preview p { font:14px var(--crm-body-font); }
.crm-style-preview b { color:#fff; display:inline-block; padding:6px 10px; border-radius:6px; background:var(--crm-accent); }
#crm-top-logo { display:flex; justify-content:flex-start; align-items:center; min-height:36px; margin:0 0 8px; padding-right:160px; }
#crm-top-logo img { max-height:52px; max-width:220px; object-fit:contain; }
.crm-style-error { color:#a33d34; font-weight:700; }
body .nav-item { font-family:var(--crm-font-menu,var(--crm-font-body)); }

.crm-style-shortcut { position:fixed; z-index:80; top:12px; right:16px; min-height:34px; padding:6px 12px; border:1px solid var(--gold); border-radius:999px; background:var(--wine); color:#fff; box-shadow:0 2px 10px rgba(0,0,0,.18); font:600 12px var(--crm-font-menu,var(--crm-font-body)); cursor:pointer; }
.crm-style-shortcut:hover { filter:brightness(1.08); transform:translateY(-1px); }
.sidebar-user > .crm-style-shortcut { position:static; z-index:auto; flex:0 0 auto; margin:0; white-space:nowrap; }
.crm-style-workbench { display:grid; grid-template-columns:minmax(400px, .9fr) minmax(480px,1.1fr); gap:22px; align-items:start; }
.crm-style-controls { min-width:0; max-height:calc(100vh - 34px); overflow:auto; padding:18px; border:1px solid var(--border); border-radius:12px; background:var(--white); }
.crm-style-controls .settings-intro { margin-bottom:12px; }
.crm-style-controls h3 { margin:18px 0 8px; color:var(--wine); font-size:14px; }
.crm-style-controls .crm-style-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.crm-style-controls .crm-color-field { min-width:0; margin:0; padding:9px; border:1px solid var(--border); border-radius:9px; }
.crm-style-controls .crm-color-field legend { padding:0 4px; color:var(--muted); font-size:12px; font-weight:600; }
.crm-color-swatches { display:flex; flex-wrap:wrap; gap:8px; }
.crm-color-swatch { display:inline-flex; align-items:center; gap:5px; padding:4px 7px; border:1px solid transparent; border-radius:999px; color:var(--ink); font-size:11px; cursor:pointer; }
.crm-color-swatch.selected { border-color:var(--wine); background:var(--cream); }
.crm-color-swatch input { position:absolute; opacity:0; pointer-events:none; }
.crm-color-swatch i { width:18px; height:18px; border:1px solid rgba(0,0,0,.2); border-radius:50%; background:var(--swatch); }
.crm-style-controls .crm-style-options { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:8px 0 12px; }
.crm-style-controls .crm-style-options label { min-width:0; font-size:12px; }
.crm-style-controls .crm-style-options select { min-width:0; padding:7px 9px; font-size:12px; }
.crm-card-style-options { align-items:start; }
.crm-card-contrast-note { align-self:center; margin:0; color:var(--muted); font-size:11px; line-height:1.45; }
.crm-style-fonts { grid-template-columns:1fr !important; }
.crm-style-fonts small { color:var(--muted); font-size:10px; }
.crm-style-controls .crm-logo-toggle { display:flex!important; align-items:center; gap:8px; }
.crm-style-controls .crm-logo-upload { display:grid; gap:6px; margin:0; }
.crm-style-controls .crm-logo-upload input { max-width:100%; }
.crm-logo-gallery { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.crm-logo-choice { display:grid; justify-items:center; gap:5px; min-width:0; padding:7px 5px; border:1px solid var(--border); border-radius:9px; background:repeating-conic-gradient(#f5f2e9 0% 25%,#fff 0% 50%) 50% / 14px 14px; color:var(--ink); cursor:pointer; }
.crm-logo-choice:hover,.crm-logo-choice.selected { border-color:var(--wine); box-shadow:0 0 0 2px color-mix(in srgb,var(--wine) 15%,transparent); }
.crm-logo-choice img { width:52px; height:52px; object-fit:contain; }
.crm-logo-choice span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:9px; }
.crm-style-duo { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:8px 0 14px; }
.crm-style-subpanel { min-width:0; padding:10px; border:1px solid var(--border); border-radius:10px; background:#fff; }
.crm-style-subpanel h3 { margin:0 0 8px!important; }
.crm-style-subpanel .crm-style-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.crm-style-subpanel .crm-color-swatch { justify-content:center; min-width:30px; min-height:30px; padding:2px; }
.crm-style-subpanel .crm-color-swatch span { display:none; }
.crm-style-subpanel .crm-color-swatch i { width:24px; height:24px; }
.crm-logo-gallery { grid-template-columns:repeat(auto-fill,minmax(54px,1fr)); gap:4px; max-height:178px; overflow:auto; }
.crm-logo-choice { display:flex; justify-content:center; padding:5px; border-color:transparent; border-radius:7px; background:transparent; }
.crm-logo-choice:hover,.crm-logo-choice.selected { background:color-mix(in srgb,var(--wine) 7%,transparent); box-shadow:none; }
.crm-logo-choice img { width:48px; height:42px; }
.crm-logo-choice span { display:none; }
.crm-logo-options { margin-top:8px!important; }
.crm-style-actions { display:flex; flex-wrap:wrap; gap:8px; }
#crm-floating-logo { position:fixed; z-index:75; pointer-events:none; display:flex; align-items:center; justify-content:center; }
#crm-floating-logo img { display:block; max-width:min(190px,22vw); max-height:90px; object-fit:contain; }
#crm-floating-logo.bottom-left { left:20px; bottom:18px; }
#crm-floating-logo.bottom-center { left:50%; bottom:18px; transform:translateX(-50%); }
#crm-floating-logo.bottom-right { right:20px; bottom:18px; }
#crm-floating-logo.watermark { inset:0; z-index:90; opacity:.075; }
#crm-floating-logo.watermark img { width:min(58vw,620px); max-width:75vw; max-height:65vh; }
.crm-style-preview-pane { position:sticky; top:14px; min-width:0; padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--white); }
.crm-preview-toolbar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:9px; margin-bottom:12px; font-size:13px; }
.crm-preview-toolbar label { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:11px; }
.crm-preview-toolbar select { max-width:190px; padding:6px 8px; border:1px solid var(--border); border-radius:999px; background:var(--white); color:var(--ink); font:inherit; }
.crm-preview-help { margin:0 0 8px; color:var(--muted); font-size:11px; }
.crm-preview-viewport { display:flex; justify-content:center; align-items:flex-start; max-height:calc(100vh - 120px); min-height:420px; overflow:auto; padding:10px; border-radius:9px; background:#e9e7df; }
.crm-preview-stage { position:relative; flex:0 0 auto; overflow:hidden; border-radius:8px; box-shadow:0 3px 16px rgba(0,0,0,.14); background:var(--cream); }
.crm-live-preview-frame { position:absolute; inset:0 auto auto 0; display:block; max-width:none; border:0; background:var(--cream); transform-origin:top left; }
.crm-preview-app { position:relative; display:flex; width:100%; min-height:480px; border-radius:8px; overflow:hidden; background:var(--crm-page); color:var(--crm-text); font:13px var(--crm-body-font); box-shadow:0 3px 16px rgba(0,0,0,.12); }
.crm-preview-logo-floating { position:absolute; z-index:2; width:110px; height:55px; object-fit:contain; pointer-events:none; }
.crm-preview-logo-floating[hidden] { display:none; }
.crm-preview-app[data-logo-location="bottom-left"] .crm-preview-logo-floating { left:10px; bottom:8px; }
.crm-preview-app[data-logo-location="bottom-center"] .crm-preview-logo-floating { left:50%; bottom:8px; transform:translateX(-50%); }
.crm-preview-app[data-logo-location="bottom-right"] .crm-preview-logo-floating { right:10px; bottom:8px; }
.crm-preview-app[data-logo-location="watermark"] .crm-preview-logo-floating { inset:0; width:100%; height:100%; padding:18%; opacity:.09; }
.crm-preview-app aside { display:flex; width:var(--crm-menu-width,168px); flex:0 0 var(--crm-menu-width,168px); flex-direction:column; gap:10px; padding:12px 9px; background:var(--crm-menu); color:var(--crm-menu-text,#fff); font:600 12px var(--crm-menu-font); }
.crm-preview-app aside img { width:48px; height:48px; object-fit:contain; align-self:flex-start; }
.crm-preview-app aside img[hidden] { display:none; }
.crm-preview-app aside nav { display:grid; gap:4px; margin-top:10px; }
.crm-preview-app aside nav span { padding:8px; border:1px solid transparent; border-radius:6px; }
.crm-preview-app aside nav span.active { background:var(--crm-gold); color:var(--crm-active-text,#171717); font-weight:700; }
.crm-preview-app aside > b { color:var(--crm-gold); }
.crm-preview-app main { flex:1; min-width:0; padding:16px; background:var(--crm-page); }
.crm-preview-app main header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:16px; }
.crm-preview-app main header small { color:#827b6d; font-size:10px; }
.crm-preview-app main header > div { display:flex; flex-wrap:wrap; align-items:center; gap:3px 7px; }
.crm-preview-app main header > div small,.crm-preview-app main header > div h2 { flex-basis:100%; }
.crm-preview-app main header > div img { width:30px; height:30px; object-fit:contain; }
.crm-preview-app main header > div img[hidden] { display:none; }
.crm-preview-app main h2 { margin:3px 0 0; color:var(--crm-accent); font:700 20px var(--crm-heading-font); }
.crm-preview-app main header button { padding:7px 10px; border:0; border-radius:6px; background:var(--crm-accent); color:white; font:600 11px var(--crm-body-font); white-space:nowrap; }
.crm-preview-filters { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:16px; }
.crm-preview-filters span { padding:7px 9px; border:1px solid color-mix(in srgb,var(--crm-card-text) 22%,transparent); border-radius:999px; background:var(--crm-card-bg); color:var(--crm-card-text); font-size:10px; }
.crm-preview-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.crm-preview-cards article { display:grid; gap:7px; min-width:0; padding:10px; border:1px solid #ddd8c8; border-radius:8px; background:var(--crm-card); font-family:var(--crm-body-font); }
.crm-preview-cards article b { color:var(--crm-accent); font:700 11px var(--crm-heading-font); }
.crm-preview-cards article strong { font-size:14px; }
.crm-preview-cards article span,.crm-preview-cards article i { color:#756f65; font-size:10px; font-style:normal; }
.crm-preview-cards article i { padding:4px 6px; border-radius:99px; background:var(--crm-gold); color:#171717; }
.crm-preview-app[data-menu-style="compact"] aside nav span { padding:5px; border-radius:3px; }
.crm-preview-app[data-menu-style="outlined"] aside nav span { border-color:color-mix(in srgb,var(--crm-menu-text,#fff) 35%,transparent); background:transparent; color:var(--crm-menu-text,#fff); }
.crm-preview-app[data-menu-style="pill"] aside nav span { border-radius:999px; }
.crm-preview-app[data-menu-text="bold"] aside nav span { font-weight:800; }
.crm-preview-app[data-menu-text="uppercase"] aside nav span { text-transform:uppercase; letter-spacing:.04em; }
.crm-preview-cards article { background:var(--crm-card-bg); color:var(--crm-card-text); border-radius:var(--crm-card-radius); }
.crm-preview-cards article b { color:var(--crm-card-text); }
.crm-preview-viewport[data-size="1024x768"] .crm-preview-app { font-size:11px; }
.crm-preview-viewport[data-size="1024x768"] .crm-preview-app aside { flex-basis:130px; }
.crm-preview-viewport[data-size="1024x768"] .crm-preview-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
.crm-preview-viewport[data-size="1024x768"] .crm-preview-cards article:nth-child(n+3) { display:none; }
.crm-preview-viewport[data-size="1366x768"] .crm-preview-app { min-height:520px; }
.crm-preview-viewport[data-size="1920x1080"] .crm-preview-app { min-height:620px; }
.crm-preview-viewport[data-size="390x844"] { min-height:480px; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-app { min-height:460px; flex-direction:column; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-app aside { flex:0 0 auto; flex-direction:row; align-items:center; padding:8px; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-app aside img { width:28px; height:28px; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-app aside nav { display:flex; flex:1; overflow:auto; margin:0; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-app aside nav span { flex:0 0 auto; padding:6px; font-size:9px; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-app aside > b { display:none; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-app main { padding:10px; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-cards { grid-template-columns:1fr; }
.crm-preview-viewport[data-size="390x844"] .crm-preview-cards article:nth-child(n+2) { display:none; }
@media(max-width:1100px) { .crm-style-workbench { grid-template-columns:1fr; } .crm-style-controls { max-height:none; } .crm-style-preview-pane { position:static; } }

/* Personal menu layout choices: side, top, bottom, and slide-out. */
body[data-crm-menu-position="top"] #app-layout,
body[data-crm-menu-position="bottom"] #app-layout { flex-direction:column; }
body[data-crm-menu-position="top"] #app-layout > .sidebar,
body[data-crm-menu-position="bottom"] #app-layout > .sidebar {
  width:100%; height:auto; min-height:64px; flex:0 0 auto; position:relative; z-index:30;
  flex-direction:row; align-items:center; gap:12px; padding:10px 18px;
}
body[data-crm-menu-position="bottom"] #app-layout > .sidebar { order:2; position:sticky; top:auto; bottom:0; box-shadow:0 -5px 18px rgba(0,0,0,.12); }
body[data-crm-menu-position="bottom"] #app-root { order:1; }
body[data-crm-menu-position="top"] #app-root { order:2; }
body[data-crm-menu-position="top"] .sidebar-title,
body[data-crm-menu-position="bottom"] .sidebar-title { flex:0 0 auto; max-width:180px; }
body[data-crm-menu-position="top"] .sidebar-title img,
body[data-crm-menu-position="bottom"] .sidebar-title img { max-height:40px!important; }
body[data-crm-menu-position="top"] .nav-menu,
body[data-crm-menu-position="bottom"] .nav-menu { display:flex; flex:1 1 auto; flex-direction:row; align-items:center; justify-content:center; flex-wrap:wrap; gap:4px; min-width:0; }
body[data-crm-menu-position="top"] .sidebar > .nav-item,
body[data-crm-menu-position="bottom"] .sidebar > .nav-item { flex:0 0 auto; white-space:nowrap; }
body[data-crm-menu-position="top"] .sidebar-user,
body[data-crm-menu-position="bottom"] .sidebar-user { flex:0 0 auto; padding:0 0 0 10px; border-top:0; }
body[data-crm-menu-position="top"] .sidebar-user #sidebar-user-name,
body[data-crm-menu-position="bottom"] .sidebar-user #sidebar-user-name { display:none; }
body[data-crm-menu-position="floating"] #app-layout > .sidebar {
  position:fixed; z-index:102; left:0; top:0; bottom:0; width:var(--crm-menu-width,220px); height:100dvh;
  transform:translateX(-105%); transition:transform .28s cubic-bezier(.2,.75,.25,1); box-shadow:8px 0 28px rgba(0,0,0,.22);
}
body.crm-menu-open[data-crm-menu-position="floating"] #app-layout > .sidebar { transform:translateX(0); }
.crm-menu-toggle { display:none; position:fixed; z-index:101; top:12px; left:14px; width:42px; height:42px; border:1px solid var(--gold); border-radius:13px; background:var(--wine); color:#fff; box-shadow:0 4px 14px rgba(0,0,0,.2); cursor:pointer; font-size:20px; }
body[data-crm-menu-position="floating"] .crm-menu-toggle { display:grid; place-items:center; }
.crm-menu-backdrop { visibility:hidden; position:fixed; z-index:100; inset:0; width:100%; height:100%; border:0; background:rgba(18,16,14,.42); opacity:0; transition:opacity .24s ease,visibility .24s ease; }
body.crm-menu-open[data-crm-menu-position="floating"] .crm-menu-backdrop { visibility:visible; opacity:1; }
body[data-crm-menu-position="floating"] #app-root { width:100%; }

.crm-preview-app[data-menu-position="top"],
.crm-preview-app[data-menu-position="bottom"] { flex-direction:column; }
.crm-preview-app[data-menu-position="top"] aside,
.crm-preview-app[data-menu-position="bottom"] aside { width:100%; min-height:50px; flex:0 0 auto; flex-direction:row; align-items:center; gap:7px; padding:7px; }
.crm-preview-app[data-menu-position="top"] aside > b,
.crm-preview-app[data-menu-position="bottom"] aside > b { flex:0 0 auto; max-width:100px; font-size:9px; }
.crm-preview-app[data-menu-position="top"] aside img,
.crm-preview-app[data-menu-position="bottom"] aside img { width:30px; height:30px; }
.crm-preview-app[data-menu-position="top"] aside nav,
.crm-preview-app[data-menu-position="bottom"] aside nav { display:flex; flex:1; flex-wrap:wrap; align-items:center; justify-content:center; gap:3px; margin:0; }
.crm-preview-app[data-menu-position="top"] aside nav span,
.crm-preview-app[data-menu-position="bottom"] aside nav span { padding:5px 7px; font-size:9px; }
.crm-preview-app[data-menu-position="bottom"] aside { order:2; }
.crm-preview-app[data-menu-position="bottom"] main { order:1; }
.crm-preview-app[data-menu-position="floating"] aside { position:absolute; z-index:5; inset:0 auto 0 0; width:var(--crm-menu-width,220px); max-width:72%; flex:0 0 auto; box-shadow:8px 0 28px rgba(0,0,0,.24); }
.crm-preview-app[data-menu-position="floating"] .crm-preview-menu-toggle { display:block; }
.crm-preview-menu-toggle { display:none; position:absolute; z-index:8; top:8px; left:8px; padding:5px 9px; border:0; border-radius:8px; background:var(--crm-accent); color:#fff; }

/* Consistent micro-interactions across the CRM. */
.btn,.nav-item,.settings-tile,.kanban-card,.prod-item,.fitting-product-card,.crm-logo-choice,
.crm-color-swatch,.crm-style-shortcut,.crm-menu-toggle,.crm-preview-app button,.crm-preview-cards article,
input,select,textarea,summary {
  transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .2s ease,
    transform .2s cubic-bezier(.2,.75,.25,1),opacity .18s ease;
}
.btn:hover,.crm-style-shortcut:hover,.crm-menu-toggle:hover,.crm-preview-app button:hover { transform:translateY(-2px); box-shadow:0 5px 14px rgba(0,0,0,.15); }
.btn:active,.crm-style-shortcut:active,.crm-menu-toggle:active,.crm-preview-app button:active { transform:translateY(0) scale(.97); }
.nav-item:hover,.settings-tile:hover,.kanban-card:hover,.prod-item:hover,.fitting-product-card:hover,.crm-logo-choice:hover { transform:translateY(-2px); }
.nav-item.active { animation:crm-nav-select .28s ease both; }
@keyframes crm-nav-select { from { transform:scale(.97); } to { transform:scale(1); } }
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}
@media(max-width:900px) {
  body[data-crm-menu-position="top"] #app-layout > .sidebar,
  body[data-crm-menu-position="bottom"] #app-layout > .sidebar { align-items:flex-start; flex-wrap:wrap; }
  body[data-crm-menu-position="top"] .nav-menu,
  body[data-crm-menu-position="bottom"] .nav-menu { justify-content:flex-start; flex-basis:100%; order:2; }
  body[data-crm-menu-position="top"] .sidebar > .nav-item,
  body[data-crm-menu-position="bottom"] .sidebar > .nav-item { order:3; }
}
@media(max-width:600px) {
  body[data-crm-menu-position="top"] #app-layout > .sidebar,
  body[data-crm-menu-position="bottom"] #app-layout > .sidebar { padding:8px; gap:5px; }
  body[data-crm-menu-position="top"] .nav-item,
  body[data-crm-menu-position="bottom"] .nav-item { padding:7px 8px; font-size:11px; }
  body[data-crm-menu-position="top"] .sidebar > .nav-item,
  body[data-crm-menu-position="bottom"] .sidebar > .nav-item { display:none; }
  body[data-crm-menu-position="top"] .nav-menu,
  body[data-crm-menu-position="bottom"] .nav-menu { flex-wrap:nowrap; overflow-x:auto; }
}

/* Персональная форма и контраст карточек товаров, производства и конструирования. */
:root { --crm-card-bg:#fff; --crm-card-text:var(--ink); --crm-card-radius:14px; --sidebar-text:#fff; --sidebar-active-text:var(--ink); }
.kanban-card,.prod-item,.fitting-product-card,.dash-stage-card,.collection-card,.rpt-card,.tz-card,.pfile-row {
  background:var(--crm-card-bg); color:var(--crm-card-text); border-radius:var(--crm-card-radius);
}
.kanban-card .meta { color:color-mix(in srgb,var(--crm-card-text) 68%,transparent); }
.kanban-card .article { color:var(--crm-card-text); }
.kanban-card .kanban-who { color:color-mix(in srgb,var(--crm-card-text) 82%,transparent); }
.kanban-card .kanban-who-constructor .kw-constructor { color:var(--crm-card-text)!important; }
.kanban-card .kanban-who-constructor .kw-empty,.kanban-card .kanban-who-factories .kw-empty { color:color-mix(in srgb,var(--crm-card-text) 78%,transparent)!important; }
.kanban-card .kanban-who-constructor .kw-constructor:hover,.kanban-card .kanban-who-constructor .kw-empty:hover,.kanban-card .kanban-who-factories .kw-empty:hover { background:color-mix(in srgb,var(--crm-card-text) 10%,transparent); }
.kanban-card.stage-overdue { color:#171717; }
.kanban-card.stage-overdue .meta { color:#5f514f; }
.prod-item,.pfile-row { border-color:color-mix(in srgb,var(--crm-card-text) 18%,transparent); }
.fitting-product-card,.rpt-card,.tz-card,.dash-stage-card,.collection-card { border-color:color-mix(in srgb,var(--crm-card-text) 18%,transparent); }
.dash-stage-card .count,.collection-card h3 { color:var(--crm-card-text); }
.pfile-name a { color:var(--crm-card-text); }
@media(max-width:600px) { .crm-style-controls { padding:12px; } .crm-style-duo { grid-template-columns:1fr; } .crm-style-controls .crm-style-grid,.crm-style-controls .crm-style-options { grid-template-columns:repeat(2,minmax(0,1fr)); } .crm-preview-viewport { min-height:350px; } }
.fitting-checklist-toolbar .fitting-copy-checklist { margin-left:auto; background:var(--wine); border-color:var(--wine); color:#fff; }
.tasks-heading { margin-bottom:8px; }
.tasks-toolbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:8px 0 12px; }
.tasks-tabs { gap:4px; margin:0; padding:3px; }
.tasks-tabs button { padding:6px 11px; font-size:12px; }
.tasks-filters { gap:7px; margin:0; padding:5px 8px; }
.tasks-size-switch { display:flex; gap:0; margin-left:auto; padding:3px; border:1px solid var(--border); border-radius:999px; background:var(--white); }
.tasks-size-switch button { padding:4px 9px; border-color:transparent; font-size:11px; }
.tasks-size-switch button.active { background:var(--ink); color:var(--white); }
.tasks-size-small .tasks-list { gap:5px; }
.tasks-size-small .task-card { padding:5px 8px; border-left-width:3px; border-radius:7px; }
.tasks-size-small .task-card-top { font-size:9px; }
.tasks-size-small .task-card h2 { font-size:12px; line-height:1.25; margin:2px 0; }
.tasks-size-small .task-card-meta,.tasks-size-small .task-source-links { gap:3px 10px; font-size:9px; }
.tasks-size-small .task-status-pill { padding:2px 6px; font-size:9px; }
.tasks-size-small .task-close-form { grid-template-columns:minmax(220px,auto) minmax(180px,1fr) auto; gap:5px; margin-top:5px; padding-top:5px; }
.tasks-size-small .task-close-form textarea { min-height:28px; padding:4px 7px; font-size:11px; }
.tasks-size-small .task-close-form .btn { min-height:28px; padding:4px 8px; font-size:11px; }
.tasks-size-large .task-card { padding:18px 20px; }
.tasks-size-large .task-card h2 { font-size:20px; }
.manual-task-form { display:grid; grid-template-columns:minmax(220px,1fr) minmax(180px,280px) auto; gap:7px; margin:0 0 12px; padding:8px; border:1px solid var(--border); border-radius:9px; background:var(--white); }
.manual-task-form input,.manual-task-form select { min-height:34px; padding:6px 9px; border:1px solid var(--border); border-radius:7px; font:inherit; }
.tasks-empty { padding:12px; border:1px dashed var(--border); border-radius:8px; color:#777; font-size:13px; }
.task-result-choices { min-width:0; margin:0; padding:0; border:0; }
.task-result-choices legend { margin-bottom:4px; color:#776f60; font-size:12px; }
.task-result-choices > div { display:flex; gap:4px; }
.task-result-choices button { padding:6px 9px; border:1px solid var(--border); border-radius:7px; background:#fff; color:#655e51; font:inherit; font-size:11px; cursor:pointer; }
.task-result-choices button[data-task-choice$=":completed"] { border-color:#b6d4ba; }
.task-result-choices button[data-task-choice$=":not_completed"] { border-color:#e0b0aa; }
.task-result-choices button[data-task-choice$=":not_relevant"] { border-color:#ead5a8; }
.task-result-choices button[data-task-choice$=":completed"].selected { background:#e5f3e8; color:#246b3c; font-weight:700; }
.task-result-choices button[data-task-choice$=":not_completed"].selected { background:#fae6e4; color:#a33d34; font-weight:700; }
.task-result-choices button[data-task-choice$=":not_relevant"].selected { background:#fff0d8; color:#8c5f19; font-weight:700; }
.fitting-additional-table-wrap { overflow-x:auto; }
.fitting-additional-table { width:100%; border-collapse:collapse; font-size:12px; }
.fitting-additional-table th { padding:7px; text-align:left; background:#f2eee5; color:#6e6049; }
.fitting-additional-table td { padding:7px; border-bottom:1px solid var(--border); vertical-align:top; }
.fitting-additional-table td:first-child { min-width:250px; white-space:pre-wrap; }
.fitting-additional-table td small { display:block; margin-top:3px; color:#817968; }
.fitting-additional-table td textarea { display:block; width:100%; min-width:180px; margin:3px 0; padding:6px; border:1px solid var(--border); border-radius:6px; font:inherit; }
.fitting-additional-table td button { margin:2px; }
.fitting-extra-copy-all { display:block; margin:0 0 6px auto; }
.sidebar { background:var(--sidebar-bg,var(--ink)); }
body[data-crm-menu-style="compact"] .nav-item { padding:6px 9px; border-radius:3px; }
body[data-crm-menu-style="outlined"] .nav-item { border:1px solid transparent; }
body[data-crm-menu-style="outlined"] .nav-item:hover,body[data-crm-menu-style="outlined"] .nav-item.active { border-color:var(--gold); }
body[data-crm-menu-style="pill"] .nav-item { border-radius:999px; }
body[data-crm-menu-text="bold"] .nav-item { font-weight:700; }
body[data-crm-menu-text="uppercase"] .nav-item { text-transform:uppercase; letter-spacing:.04em; font-size:.9em; }
.login-screen { background:var(--sidebar-bg,var(--ink)); }
.sidebar-user { color:var(--white); }
@media(max-width:760px){.manual-task-form{grid-template-columns:1fr}.tasks-toolbar{align-items:stretch}.tasks-size-switch{margin-left:0}.crm-style-preview aside{width:120px}}

/* Компактные чек-листы примерки и редактирование комментариев в строке */
.fitting-checklist-section-row th { padding:5px 8px; background:#f3eee4; color:#6f1a19; text-align:left; font-size:12px; }
.fitting-checklist-table .fitting-checklist-section-row:hover th { background:#f3eee4; }
.fitting-checklist-number { display:inline-block; min-width:22px; color:#746b59; font-variant-numeric:tabular-nums; }
.fitting-checklist-table th { padding:4px 7px; }
.fitting-checklist-table td { padding:2px 5px; }
.fitting-checklist-table .fitting-checklist-item-text { font-size:11px; line-height:1.25; }
.fitting-checklist-table .fitting-checklist-result button { width:22px; height:22px; font-size:13px; }
.fitting-checklist-table textarea,.fitting-checklist-table select { padding:3px 5px; font-size:11px; }
.fitting-checklist-table textarea { min-height:27px; height:27px; }
.fitting-checklist-table textarea:focus { min-height:54px; height:54px; }
.fitting-checklist-table select { min-height:27px; }
.fitting-responsibility-picker { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); align-items:center; gap:4px; min-width:0; }
.fitting-responsibility-picker select { min-width:0; width:100%; min-height:27px; padding:3px 4px; font-size:10px; }
.fitting-checklist-table textarea.fitting-checklist-comment { display:block; min-height:28px; height:28px; max-height:none; overflow:hidden; resize:none; line-height:1.35; white-space:pre-wrap; overflow-wrap:anywhere; }
.fitting-checklist-table textarea.fitting-checklist-comment:focus { min-height:28px; height:28px; }
.fitting-checklist-table td:nth-child(3),.fitting-checklist-table td:nth-child(4) { vertical-align:middle; }
.fitting-responsibility-link { display:block; grid-column:1/-1; width:100%; min-width:0; padding:4px 0; border:0; background:transparent; color:var(--wine); font:inherit; font-size:11px; line-height:1.3; text-align:left; cursor:pointer; }
.fitting-responsibility-link:hover { text-decoration:underline; }
.fitting-responsibility-entity-slot { display:contents; }
.fitting-responsibility-search { position:relative; display:block; grid-column:1/-1; min-width:0; }
.fitting-responsibility-search input { width:100%; min-width:0; min-height:29px; padding:5px 8px; border:1px solid var(--border); border-radius:6px; background:var(--white); color:var(--ink); font:inherit; font-size:11px; }
.fitting-responsibility-search-results { position:absolute; z-index:30; top:calc(100% + 3px); left:0; right:0; max-height:220px; overflow:auto; padding:4px; border:1px solid var(--border); border-radius:7px; background:var(--white); box-shadow:0 8px 22px rgba(0,0,0,.16); }
.fitting-responsibility-search-results[hidden] { display:none; }
.fitting-responsibility-search-results button { display:block; width:100%; padding:7px 8px; border:0; border-radius:4px; background:transparent; color:var(--ink); text-align:left; font:inherit; font-size:12px; cursor:pointer; }
.fitting-responsibility-search-results button:hover { background:var(--cream); }
.fitting-responsibility-no-results { display:block; padding:7px 8px; color:#746c5e; font-size:11px; }
.fitting-entry-history { margin-top:3px; font-size:10px; }
.fitting-entry-history > summary { font-size:10px; }
.fitting-checklist-table .fitting-entry-history > div { max-height:180px; overflow:auto; }
.fitting-additional-table { table-layout:fixed; }
.fitting-additional-table th { padding:5px 7px; }
.fitting-additional-table td { padding:4px 6px; }
.fitting-additional-table th:nth-child(1) { width:42%; }
.fitting-additional-table th:nth-child(2) { width:21%; }
.fitting-additional-table th:nth-child(3) { width:34%; }
.fitting-additional-table th:nth-child(4),.fitting-additional-table td:last-child { width:32px; }
.fitting-additional-table td:last-child { text-align:right; white-space:nowrap; }
.fitting-additional-table th:nth-child(1) { width:38%; }
.fitting-additional-table th:nth-child(2) { width:22%; }
.fitting-additional-table th:nth-child(3) { width:31%; }
.fitting-additional-table th:nth-child(4) { width:36px; }
.fitting-additional-table th:nth-child(5),.fitting-additional-table td:last-child { width:32px; }
.fitting-additional-history-cell { text-align:center; vertical-align:middle!important; }
.fitting-additional-history-cell .fitting-entry-history { margin:0; }
.fitting-additional-table td select,.fitting-additional-table td input,.fitting-additional-table td textarea { min-width:0; width:100%; box-sizing:border-box; min-height:28px; padding:4px 6px; border:1px solid var(--border); border-radius:6px; background:var(--white); color:var(--ink); font:inherit; font-size:11px; }
.extra-comment-display { display:block; cursor:text; white-space:pre-wrap; overflow-wrap:anywhere; }
.extra-comment-display:hover { color:var(--wine); }
.extra-task-inline { display:grid; grid-template-columns:minmax(92px,.8fr) minmax(110px,1.2fr); gap:4px; align-items:center; }
.fitting-extra-delete { width:24px; height:24px; padding:0; border:0; border-radius:50%; background:#f7e7e5; color:#a33d34; font-size:19px; line-height:1; cursor:pointer; }
.fitting-extra-delete:hover { background:#a33d34; color:#fff; }

/* Подробные роли и доступы: матрица для администраторов */
.users-access-tabs { display:flex; flex-wrap:wrap; gap:7px; margin:0 0 14px; }
#role-access-bar { position:sticky; top:0; z-index:40; padding:7px 12px; background:#f7f0df; color:#715622; border-bottom:1px solid var(--gold); text-align:center; font-size:12px; }
.users-access-tabs button { border:1px solid var(--gold); border-radius:999px; padding:7px 13px; background:var(--white); color:var(--ink); font:inherit; font-size:13px; font-weight:600; cursor:pointer; }
.users-access-tabs button.active { background:var(--ink); border-color:var(--ink); color:var(--white); }
.users-role-layout { display:grid; grid-template-columns:minmax(190px,260px) minmax(0,1fr); gap:14px; align-items:start; }
.users-role-list,.users-access-panel { min-width:0; padding:15px; border:1px solid var(--border); border-radius:12px; background:var(--white); }
.users-role-list h3 { margin:0 0 10px; }
.users-role-card { display:flex; flex-direction:column; align-items:flex-start; width:100%; margin:0 0 7px; padding:10px 12px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); text-align:left; cursor:pointer; }
.users-role-card.selected { border:2px solid var(--ink); background:#f7f5ef; }
.users-role-card.archived { opacity:.62; }
.users-role-card small { margin-top:4px; color:#766e60; }
.users-new-role { display:grid; gap:6px; margin-top:12px; }
.users-new-role input,.users-role-title input { width:100%; min-width:0; padding:8px 10px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; }
.users-role-title { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:10px; }
.users-role-title > div:first-child { flex:1; display:grid; gap:7px; }
.users-role-title small { color:#766e60; line-height:1.5; }
.users-role-title-actions { display:flex; gap:6px; flex-wrap:wrap; }
.users-access-quick { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin:13px 0; }
.users-access-quick span { margin-right:4px; color:#766e60; font-size:12px; }
.users-access-quick button { padding:6px 9px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; font-size:12px; cursor:pointer; }
.users-access-scroll { max-width:100%; overflow:auto; }
.users-access-table,.users-access-overview { width:100%; border-collapse:collapse; font-size:13px; }
.users-access-table th,.users-access-table td,.users-access-overview th,.users-access-overview td { padding:8px 9px; border-bottom:1px solid #eee9df; text-align:left; vertical-align:middle; }
.users-access-table thead th { background:#f4f0e7; color:#6d5833; font-size:11px; text-transform:uppercase; letter-spacing:.05em; }
.users-access-table td:last-child { width:1%; white-space:nowrap; }
.users-access-group th { padding:11px 8px 5px; color:#806334; font-size:11px; letter-spacing:.07em; text-transform:uppercase; }
.access-level-picker { display:inline-flex; overflow:hidden; border:1px solid var(--gold); border-radius:7px; }
.access-level-picker button { min-width:94px; padding:6px 8px; border:0; border-right:1px solid var(--gold); background:var(--white); color:#735f3c; font:inherit; font-size:11px; cursor:pointer; }
.access-level-picker button:last-child { border-right:0; }
.access-level-picker button.active { background:#e5f2e8; color:#28633a; font-weight:700; }
.access-level-picker button[data-level="none"].active { background:#f4e9e7; color:#973b32; }
.access-level-picker button[data-level="view"].active { background:#f7f0df; color:#806334; }
.users-access-extra { margin-top:14px; padding:10px; border:1px solid var(--border); border-radius:8px; }
.users-access-extra summary { cursor:pointer; font-weight:700; }
.users-access-extra label { display:inline-flex; align-items:center; gap:6px; margin:8px 16px 0 0; font-size:12px; }
.users-access-savebar { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-top:12px; }
.users-access-savebar small { color:#806334; }
.users-access-overview { min-width:780px; }
.users-matrix-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:10px; }
.users-matrix-heading h2 { margin:0 0 5px; }
.users-matrix-heading p { margin:0; }
.users-role-toolbar { display:flex; gap:8px; flex-shrink:0; }
.users-access-quick button:disabled { opacity:.5; cursor:not-allowed; }
.users-access-editable { table-layout:fixed; min-width:1050px; border-collapse:separate; border-spacing:0; }
.users-access-editable th:first-child,.users-access-editable td:first-child { width:230px; }
.users-access-editable tbody td:first-child { position:sticky; left:0; z-index:2; background:var(--white); box-shadow:1px 0 0 #eee9df; }
.users-access-editable thead th { position:sticky; top:0; z-index:3; }
.users-access-editable thead th:first-child { left:0; z-index:5; background:#171717; }
.users-access-editable tr.users-access-group th { position:sticky; left:0; z-index:4; width:230px; background:#f4f0e7; box-shadow:1px 0 0 #eee9df; }
.users-access-editable tr.users-access-group td { background:#f4f0e7; }
.users-access-editable td:not(:first-child) { text-align:center; }
.users-access-editable thead th { min-width:130px; white-space:normal; overflow-wrap:anywhere; }
.users-access-editable thead th strong { display:block; font-size:12px; line-height:1.25; }
.users-access-editable td { padding:5px 7px; }
.access-level-editable,.access-action-toggle { width:100%; min-height:29px; border:1px solid transparent; cursor:pointer; transition:filter .12s ease,transform .12s ease; }
.access-level-editable:hover,.access-action-toggle:hover { filter:brightness(.96); transform:translateY(-1px); }
.access-level-editable:focus-visible,.access-action-toggle:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
.access-level.access-none { background:#f4e9e7; color:#973b32; }
.access-inline-picker { display:flex; flex-direction:column; gap:3px; min-width:120px; }
.access-inline-picker button { display:block; width:100%; min-width:0; padding:5px 7px; border:1px solid var(--border); border-radius:6px; font:inherit; font-size:11px; line-height:1.2; white-space:normal; overflow-wrap:break-word; cursor:pointer; }
.access-inline-picker button.selected { outline:2px solid var(--gold); outline-offset:1px; font-weight:700; }
.users-access-matrix-panel .users-access-savebar { justify-content:flex-start; }
.users-access-matrix-panel .users-access-savebar small { color:#766e60; }
.role-editor-modal { max-width:900px; }

/* Task board and access matrix refinements */
.tasks-board { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; align-items:start; overflow-x:auto; padding-bottom:5px; }
.tasks-lane { min-width:0; min-height:160px; padding:8px; border:1px solid var(--border); border-radius:10px; background:rgba(255,255,255,.38); }
.tasks-lane > h2 { display:flex; justify-content:space-between; align-items:center; margin:0 0 8px; padding:3px 4px 8px; border-bottom:1px solid var(--border); font-size:14px; }
.tasks-lane > h2 [data-task-lane-count] { min-width:22px; padding:2px 7px; border-radius:999px; background:#eee9df; color:#655e51; text-align:center; font-size:11px; }
.tasks-lane { transition:background-color .16s ease,border-color .16s ease,box-shadow .16s ease; }
.tasks-lane.drag-over { border:2px solid #aa8954; background:rgba(248,239,219,.82); box-shadow:0 0 0 3px rgba(170,137,84,.14),0 8px 22px rgba(67,49,18,.09); }
.tasks-lane.drag-over > h2 { color:#6c4b1c; border-bottom-color:#c5a66f; }
.tasks-lane.drag-over .tasks-lane-cards::before { content:'Отпустите, чтобы переместить сюда'; display:block; padding:7px 9px; border:1px dashed #b69761; border-radius:8px; background:rgba(255,255,255,.65); color:#745a2d; font-size:11px; text-align:center; }
.tasks-lane-cards { display:grid; gap:7px; min-height:95px; }
.tasks-lane .task-card { padding:9px 10px; cursor:grab; }
.tasks-lane .task-card:active { cursor:grabbing; }
.tasks-lane .task-card-summary { position:relative; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:3px 7px; align-items:center; padding-right:19px; cursor:pointer; list-style:none; }
.tasks-lane .task-card-summary::-webkit-details-marker { display:none; }
.tasks-lane .task-card-drag-handle { grid-column:1; grid-row:1; display:inline-flex; align-items:center; justify-content:center; width:20px; height:24px; border-radius:5px; color:#958873; cursor:grab; user-select:none; touch-action:none; }
.tasks-lane .task-card-drag-placeholder { grid-column:1; grid-row:1; width:20px; height:24px; }
.tasks-lane .task-card-drag-handle:hover,.tasks-lane .task-card-drag-handle:focus-visible { background:#f2eadb; color:#67451f; outline:none; }
.tasks-lane .task-card-drag-handle:active { cursor:grabbing; }
.tasks-lane .task-card-title { grid-column:2; grid-row:1; min-width:0; overflow:hidden; font-size:14px; font-weight:700; line-height:1.3; text-overflow:ellipsis; }
.tasks-lane .task-card-summary .task-card-badges { grid-column:3; grid-row:1; justify-self:end; display:flex; align-items:center; gap:4px; margin-right:13px; }
.tasks-lane .task-card-summary .task-status-pill { display:flex; align-items:center; justify-content:flex-start; min-width:74px; box-sizing:border-box; padding:2px 7px; font-size:10px; font-weight:600; text-align:left; white-space:nowrap; }
.tasks-lane .task-card-summary .task-status-pill::before { content:''; display:inline-block; width:6px; height:6px; margin-right:5px; border-radius:50%; background:currentColor; opacity:.75; vertical-align:1px; }
.tasks-lane .task-overdue-pill { display:inline-flex; align-items:center; min-height:17px; padding:1px 7px; border:1px solid rgba(171,105,35,.22); border-radius:999px; background:#fff2dc; color:#8b5a1e; font-size:9px; font-weight:700; white-space:nowrap; }
.tasks-lane .task-card-summary small { grid-column:1/-1; }
.tasks-lane .task-card-summary small { grid-column:2/-1; color:#817968; font-size:10px; }
.tasks-lane .task-card-content { padding-top:7px; }
.tasks-lane .task-card { transition:opacity .2s ease,transform .24s ease,box-shadow .2s ease; }
.tasks-lane .task-card-moving { opacity:.35; transform:scale(.97); }
.tasks-lane .task-card-entering { animation:task-card-arrive .32s cubic-bezier(.2,.75,.25,1) both; }
@keyframes task-card-arrive { from { opacity:.35; transform:translateY(-9px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
.task-active { background:rgba(174,143,82,.12); color:#76603a; }
.task-completed { background:rgba(73,134,91,.11); color:#3d7250; }
.task-not-completed { background:rgba(184,75,66,.10); color:#a3534b; }
.task-not-relevant { background:rgba(194,139,53,.13); color:#946c31; }
.task-rework-pill { background:#f5e4bd; color:#704c11; box-shadow:inset 0 0 0 1px rgba(151,104,25,.24); }
.tasks-lane .task-card.task-completed { border-left-color:rgba(69,129,91,.56); }
.tasks-lane .task-card.task-not-completed { border-left-color:rgba(184,75,66,.56); }
.tasks-lane .task-card.task-not-relevant { border-left-color:rgba(194,139,53,.62); }
.tasks-lane .task-card.task-rework-active { border-left-color:rgba(194,139,53,.66); background:rgba(255,250,240,.76); }
.task-rework-form [data-task-rework] { justify-self:start; }
.tasks-lane .task-card-dragging { opacity:.55; }
.task-lane-actions { display:flex; flex-wrap:wrap; gap:5px; margin-top:7px; }
.task-lane-actions .btn { min-height:27px; padding:4px 8px; font-size:11px; }
.tasks-lane .task-close-form { grid-template-columns:1fr; gap:5px; margin-top:7px; padding-top:7px; }
.tasks-lane .task-result-choices > div { flex-wrap:wrap; }
.tasks-lane .task-result-choices button { padding:4px 7px; font-size:10px; }
.tasks-lane .task-close-form textarea { min-height:32px; }
.tasks-size-small .tasks-board { gap:7px; }
.tasks-size-small .tasks-lane { min-width:220px; padding:6px; }
.tasks-size-small .tasks-lane > h2 { font-size:12px; }
.tasks-size-small .tasks-lane .task-card { padding:6px 7px; }
.tasks-size-small .tasks-lane .task-card-title { font-size:11px; }
.tasks-size-small .tasks-lane .task-card-meta,.tasks-size-small .tasks-lane .task-source-links { font-size:9px; }
.tasks-size-small .tasks-lane .task-close-form { grid-template-columns:1fr; }
.tasks-size-large .tasks-lane .task-card-title { font-size:17px; }
.tasks-lane .task-close-form { grid-template-columns:minmax(0,1fr) auto; align-items:center; }
.tasks-lane .task-close-form .task-result-choices { grid-column:1; grid-row:1; }
.tasks-lane .task-close-form label { grid-column:1/-1; grid-row:2; }
.tasks-lane .task-close-form [data-task-close] { grid-column:2; grid-row:1; white-space:nowrap; }
.extra-task-inline { display:grid; grid-template-columns:1fr auto; gap:4px; align-items:center; }
.extra-task-statuses { display:flex; flex-wrap:wrap; gap:3px; grid-column:1/-1; }
.extra-task-statuses button { padding:4px 6px; border:1px solid var(--border); border-radius:6px; background:#fff; color:#655e51; font:inherit; font-size:10px; cursor:pointer; }
.extra-task-statuses button[data-extra-choice$=":completed"].selected { background:#e5f3e8; color:#246b3c; border-color:#b6d4ba; }
.extra-task-statuses button[data-extra-choice$=":not_completed"].selected { background:#fae6e4; color:#a33d34; border-color:#e0b0aa; }
.extra-task-statuses button[data-extra-choice$=":not_relevant"].selected { background:#fff0d8; color:#8c5f19; border-color:#ead5a8; }
.extra-task-inline [data-extra-resolution] { grid-column:1; }
.extra-task-inline [data-extra-close] { grid-column:2; grid-row:2; min-height:28px; padding:4px 7px; font-size:10px; white-space:nowrap; }
.users-access-matrix-panel { min-width:0; width:100%; }
.users-access-matrix-panel .users-access-scroll { width:100%; min-width:0; max-width:100%; overflow:auto; position:relative; }
.users-access-editable { width:max-content; min-width:max(1050px,100%); border-collapse:separate; border-spacing:0; }
.users-access-editable th:first-child,.users-access-editable td:first-child,.users-access-editable tr.users-access-group th { width:230px; min-width:230px; }
.users-access-editable tr.users-access-group th { color:#705626 !important; background:#f4f0e7 !important; }
.users-access-editable tr.users-access-group td { background:#f4f0e7; }
.users-access-editable tbody tr:not(.users-access-group) td:first-child { position:sticky; left:0; z-index:4; background:var(--white); box-shadow:1px 0 0 #ded8ce; }
.users-access-editable thead th:first-child { position:sticky; left:0; z-index:7; color:#fff; background:#171717; }
.users-access-editable tbody tr.users-access-group th { position:sticky; left:0; z-index:5; box-shadow:1px 0 0 #ded8ce; }
.users-access-editable thead th:not(:first-child),.users-access-editable tbody td:not(:first-child) { width:170px; min-width:170px; }
.fitting-responsibility-search-results { position:fixed; z-index:10000; top:0; left:0; max-height:min(260px,40vh); }
.fitting-responsibility-search-results { box-sizing:border-box; }
.fitting-checklist-popover-floating { position:fixed !important; z-index:10001 !important; display:grid !important; gap:5px; max-height:min(220px,calc(100vh - 24px)); overflow:auto; padding:9px 10px; border:1px solid var(--border); border-radius:9px; background:var(--white); box-shadow:0 10px 28px rgba(35,29,20,.18); color:var(--ink); text-align:left; white-space:normal; font-size:11px; line-height:1.4; }
.fitting-checklist-popover-floating > div { overflow-wrap:anywhere; }
.fitting-checklist-popover-floating b { color:var(--wine); }
.fitting-responsibility-search { z-index:100; }
@media (max-width:900px) { .tasks-board { grid-template-columns:repeat(3,minmax(220px,75vw)); } }
.users-access-matrix-panel { display:block; box-sizing:border-box; min-inline-size:0; max-inline-size:100%; overflow:hidden; }
.users-access-matrix-panel .users-access-scroll { display:block; box-sizing:border-box; inline-size:100%; min-inline-size:0; max-inline-size:100%; overflow-x:auto; overflow-y:scroll; overscroll-behavior-x:contain; scrollbar-gutter:stable; }
.users-access-matrix-panel .users-access-editable { display:table; table-layout:fixed; width:max-content; }
.users-access-editable tbody td:first-child,.users-access-editable tbody tr.users-access-group th { background:var(--white); }
.manual-task-toolbar { display:flex; justify-content:flex-end; margin:0 0 12px; }
.manual-task-modal-grid { display:grid; gap:12px; }
.manual-task-modal-grid .field-row { display:grid; gap:5px; margin:0; }
.manual-task-modal-grid input,.manual-task-modal-grid textarea,.manual-task-modal-grid select { box-sizing:border-box; width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:8px; background:var(--cream); color:var(--ink); font:inherit; }
.manual-task-modal-grid textarea { resize:vertical; }
.manual-task-modal-meta { display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; align-items:end; padding:10px; border-radius:8px; background:#f7f4ec; }
.manual-task-modal-meta > div:first-child { display:grid; gap:5px; padding:8px 0; }
.manual-task-modal-meta small { color:#766e60; }
.task-description { margin:0 0 8px; white-space:pre-wrap; font-size:12px; line-height:1.45; }
@media(max-width:650px){.manual-task-modal-meta{grid-template-columns:1fr}.users-access-matrix-panel .users-access-scroll{overflow-x:auto}}
.users-role-modal-help { margin:0 0 12px; color:#766e60; font-size:13px; line-height:1.45; }
.users-role-modal-bulk { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:0 0 12px; padding:9px; border-radius:8px; background:#f7f4ec; }
.users-role-modal-bulk span { margin-right:5px; color:#766e60; font-size:12px; font-weight:700; }
.users-role-modal-bulk button { padding:6px 9px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; font-size:12px; cursor:pointer; }
.users-role-modal-bulk button:disabled { opacity:.5; cursor:not-allowed; }
.role-modal-table { font-size:13px; }
.role-modal-table th:first-child { width:32%; }

/* Планёрки: быстрый подбор артикула и понятные итоги обсуждений */
.meeting-add-toolbar { position:relative; display:flex; align-items:center; gap:8px; max-width:900px; margin:0 0 10px; }
.meeting-add-toolbar .search-input { flex:1; min-width:180px; }
.meeting-add-results { position:absolute; z-index:100; top:calc(100% + 4px); left:0; right:0; max-height:360px; overflow:auto; padding:5px; border:1px solid var(--border); border-radius:10px; background:var(--white); box-shadow:0 10px 28px rgba(0,0,0,.13); }
.meeting-add-results[hidden] { display:none; }
.meeting-add-result { display:flex; align-items:center; gap:10px; width:100%; padding:7px; border:0; border-radius:7px; background:transparent; color:var(--ink); text-align:left; cursor:pointer; }
.meeting-add-result:hover { background:var(--cream); }
.meeting-add-result img,.meeting-add-empty-photo { flex:0 0 42px; width:42px; height:52px; object-fit:cover; border-radius:5px; background:var(--cream); }
.meeting-add-empty-photo { display:grid; place-items:center; color:#887d6b; font-size:10px; }
.meeting-add-result span:last-child { display:grid; gap:2px; min-width:0; }
.meeting-add-result small { color:#817968; white-space:normal; }
.meeting-add-no-results { padding:10px; color:#817968; }
.meeting-note-actions { display:flex; flex-wrap:wrap; gap:6px; margin:7px 0; }
.meeting-outcome { display:inline-flex; margin-top:5px; padding:3px 8px; border-radius:999px; font-size:11px; font-weight:700; }
.meeting-outcome-task { background:#e5f3e8; color:#246b3c; }
.meeting-outcome-none { background:#eee9df; color:#655e51; }
.manual-task-modal-meta { grid-template-columns:minmax(120px,.8fr) minmax(220px,1.3fr) minmax(170px,1fr); }
.manual-task-modal-meta .field-row { min-width:0; }
.manual-task-modal-meta select { min-width:0; max-width:100%; text-overflow:ellipsis; }
.users-access-matrix-panel { min-width:0!important; width:100%!important; max-width:100%!important; overflow:hidden!important; }
.users-access-matrix-panel > .users-access-scroll { width:100%!important; max-width:100%!important; min-width:0!important; overflow-x:scroll!important; overflow-y:auto!important; position:relative!important; }
.users-access-matrix-panel .users-access-editable { width:max-content!important; min-width:max(1050px,100%)!important; }
.users-access-matrix-panel .users-access-editable thead th:first-child,
.users-access-matrix-panel .users-access-editable tbody tr:not(.users-access-group) td:first-child,
.users-access-matrix-panel .users-access-editable tbody tr.users-access-group th { position:sticky!important; left:0!important; inset-inline-start:0!important; }
.users-access-matrix-panel .users-access-editable tbody tr:not(.users-access-group) td:first-child { z-index:8!important; background:var(--white)!important; }
.users-access-matrix-panel .users-access-editable tbody tr.users-access-group th { z-index:9!important; background:#f4f0e7!important; }
.users-access-matrix-panel .users-access-editable thead th:first-child { z-index:10!important; background:#171717!important; }
.task-observers-line { position:relative; }
.task-add-observer { padding:1px 6px; border:1px solid var(--border); border-radius:999px; background:var(--white); color:#735c36; font:inherit; font-size:10px; cursor:pointer; }
.task-observer-editor { position:relative; display:inline-flex; margin-left:5px; vertical-align:middle; }
.task-observer-editor[hidden],.task-observer-results[hidden] { display:none; }
.task-observer-editor input { width:170px; max-width:42vw; padding:5px 8px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; font-size:11px; }
.task-observer-results { position:absolute; z-index:30; top:calc(100% + 4px); left:0; display:grid; min-width:190px; max-height:190px; overflow:auto; padding:4px; border:1px solid var(--border); border-radius:8px; background:var(--white); box-shadow:0 8px 22px rgba(40,32,18,.16); }
.task-observer-results button { padding:6px 8px; border:0; border-radius:5px; background:transparent; color:var(--ink); font:inherit; font-size:11px; text-align:left; cursor:pointer; }
.task-observer-results button:hover { background:#f3eee3; }
.task-observer-results .muted { padding:6px 8px; font-size:10px; }

/* Compact polish for the requested task, analytics and fitting checklist controls. */
.task-card-meta .task-observers-line { flex:0 0 100%; display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-top:3px; padding:6px 9px; border:1px solid color-mix(in srgb,var(--border) 78%,transparent); border-radius:8px; background:color-mix(in srgb,var(--cream) 56%,white); }
.task-card-meta .task-observers-line > b { color:var(--wine); font-size:11px; font-weight:700; }
.task-card-meta [data-task-observer-names] { color:var(--ink); }
.task-add-observer { min-width:25px; min-height:23px; padding:1px 8px; border-color:color-mix(in srgb,var(--gold) 52%,var(--border)); color:var(--wine); font-weight:700; }
.task-add-observer:hover { background:var(--cream); border-color:var(--gold); }

.analytics-action-group { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; margin:0 0 10px; padding:10px; border:1px solid var(--border); border-radius:12px; background:color-mix(in srgb,var(--cream) 48%,white); }
.analytics-panel-switcher { display:flex; align-items:center; gap:8px; }
.analytics-panel-tab { min-height:34px; padding:7px 16px; border:1px solid var(--wine); border-radius:999px; background:var(--wine); color:#fff; font:inherit; font-size:12px; font-weight:700; cursor:pointer; transition:background .18s,border-color .18s,color .18s,box-shadow .18s,transform .18s; }
.analytics-panel-tab:hover { background:color-mix(in srgb,var(--wine) 88%,black); border-color:color-mix(in srgb,var(--wine) 88%,black); box-shadow:0 3px 10px rgba(70,20,20,.14); transform:translateY(-1px); }
.analytics-panel-tab.active { background:color-mix(in srgb,var(--wine) 82%,black); border-color:var(--gold); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--gold) 45%,transparent); }
.analytics-panel-tab:focus-visible { outline:2px solid var(--gold); outline-offset:2px; }
.analytics-panel-content { min-width:0; max-width:100%; margin:0!important; padding:12px!important; border:1px solid var(--border)!important; border-radius:10px; background:var(--white)!important; }
.analytics-panel-content[hidden] { display:none!important; }
.niche-autosave-state { display:block; min-height:14px; margin-top:5px; color:var(--muted); font-size:10px; }
.fitting-load-error { display:flex; align-items:flex-start; gap:14px; max-width:720px; margin:28px auto; padding:20px; border:1px solid color-mix(in srgb,var(--wine) 25%,var(--border)); border-radius:14px; background:var(--white); box-shadow:0 8px 28px rgba(40,32,18,.07); }
.fitting-load-error-mark { display:grid; flex:0 0 30px; width:30px; height:30px; place-items:center; border-radius:50%; background:color-mix(in srgb,var(--wine) 12%,white); color:var(--wine); font-weight:800; }
.fitting-load-error p { margin:5px 0 12px; color:var(--muted); font-size:12px; }
.fitting-history-lazy-content { padding:10px 0 2px; }
.analytics-recommendations-action { display:flex; align-items:center; gap:8px; min-height:34px; }
.analytics-recommendations-action > small { color:var(--muted); font-size:11px; }
.analytics-recommendation-star { display:grid; place-items:center; width:34px; height:34px; border:1px solid color-mix(in srgb,var(--gold) 65%,var(--border)); border-radius:50%; background:var(--cream); color:var(--wine); font-family:inherit; font-size:21px; font-weight:700; line-height:1; cursor:pointer; transition:transform .18s,background .18s,border-color .18s,box-shadow .18s; }
.analytics-recommendation-star:hover { transform:translateY(-1px) rotate(8deg); background:#f4ead5; border-color:var(--gold); box-shadow:0 4px 12px rgba(78,36,20,.12); }
.analytics-recommendation-star:active { transform:scale(.93); }
.analytics-recommendation-star:focus-visible { outline:2px solid var(--wine); outline-offset:2px; }
.analytics-recommendation-star:disabled { cursor:wait; opacity:.75; }
.analytics-recommendation-star.is-loading { animation:analytics-star-pulse .8s ease-in-out infinite alternate; }
.analytics-recommendation-star.is-loading::after { content:''; width:15px; height:15px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:analytics-spin .7s linear infinite; }
.analytics-recommendation-star.is-loading { font-size:0; }
@keyframes analytics-spin { to { transform:rotate(360deg); } }
@keyframes analytics-star-pulse { to { background:#f3e7cc; box-shadow:0 0 0 4px rgba(166,138,88,.12); } }

.fitting-checklist-table { min-width:1000px; }
.fitting-checklist-table .fit-col-item { width:22%; }
.fitting-checklist-table .fit-col-choice { width:7%; }
.fitting-checklist-table .fit-col-comment { width:31%; }
.fitting-checklist-table .fit-col-area { width:22%; }
.fitting-checklist-table .fit-col-task { width:10%; }
.fitting-checklist-table .fit-col-history { width:8%; }
.fitting-checklist-table th:nth-child(5),.fitting-checklist-table th:nth-child(6) { text-align:center; }
.fitting-checklist-task-cell,.fitting-checklist-history-cell { position:relative; text-align:center; white-space:nowrap; }
.fitting-task-empty { color:#b5ad9d; }
.fitting-entry-history,.fitting-entry-task { position:relative; display:inline-block; margin:0; vertical-align:middle; }
.fitting-checklist-table .fitting-checklist-item-text .fitting-entry-history { display:none; }
.fitting-entry-task > summary { display:inline-flex; align-items:center; justify-content:center; min-height:23px; max-width:100%; list-style:none; cursor:pointer; }
.fitting-entry-task > summary::-webkit-details-marker { display:none; }
.fitting-entry-task .task-status-pill { padding:3px 7px; font-size:10px; }
.fitting-entry-task-popover,.fitting-entry-history > div { position:absolute; z-index:80; top:calc(100% + 5px); right:0; display:grid; gap:5px; width:min(320px,70vw); max-height:220px; overflow:auto; padding:9px 10px; border:1px solid var(--border); border-radius:9px; background:var(--white); box-shadow:0 10px 28px rgba(35,29,20,.18); color:var(--ink); text-align:left; white-space:normal; font-size:11px; line-height:1.4; }
.fitting-entry-task-popover > div { overflow-wrap:anywhere; }
.fitting-entry-task-popover b { color:var(--wine); }
.fitting-entry-history > summary { min-width:22px; height:22px; font-size:14px; }
.fitting-entry-history > div { width:min(360px,75vw); }
.fitting-entry-history-change { padding:5px 7px; }
.fitting-checklist-table-scroll { max-width:100%; overscroll-behavior-x:contain; }
.product-fitting-checklist-table { min-width:1000px!important; }
.product-fitting-checklist-table .fitting-checklist-comment + .task-source-state { display:none; }
@media (max-width:700px) {
  .analytics-action-group { gap:6px; padding:6px; }
  .analytics-panel-switcher { flex-wrap:wrap; }
  .analytics-panel-tab { flex:1 1 auto; }
  .analytics-recommendations-head { align-items:flex-start; }
  .fitting-checklist-table { min-width:900px; }
  .product-fitting-checklist-table { min-width:900px!important; }
}
@media (prefers-reduced-motion:reduce) {
  .analytics-recommendation-star,.analytics-recommendation-star.is-loading,.analytics-panel-tab { animation:none!important; transition:none!important; }
}
.telegram-link-state { font-size:11px; white-space:nowrap; }
.telegram-link-state.is-linked { color:#267445; }
.telegram-link-state.is-unlinked { color:#9a6c2b; }
@media(max-width:650px){.meeting-add-toolbar{align-items:stretch;flex-wrap:wrap}.meeting-add-toolbar .search-input{flex-basis:100%}.manual-task-modal-meta{grid-template-columns:1fr}}
.role-modal-table td:last-child { width:auto; }

/* Planner and task controls follow the CRM segmented-button system. */
#view-meeting .meeting-size-switch,
.tasks-size-switch { display:flex; align-items:center; gap:2px; width:max-content; max-width:100%; padding:3px; border:1px solid var(--border); border-radius:999px; background:var(--white); }
#view-meeting .meeting-size-switch button,
.tasks-size-switch button { min-height:30px; padding:5px 12px; border:0; border-radius:999px; background:transparent; color:var(--ink); font:inherit; font-size:12px; line-height:1.1; white-space:nowrap; cursor:pointer; }
#view-meeting .meeting-size-switch button:hover,
.tasks-size-switch button:hover { background:var(--cream); }
#view-meeting .meeting-size-switch button.active,
.tasks-size-switch button.active { background:var(--ink); color:var(--white); }
#view-meeting .meeting-thread-thumb { transition:transform .15s ease, box-shadow .15s ease; }
#view-meeting .meeting-thread-thumb:hover { transform:scale(1.15); }
.hover-preview.meeting-photo-preview { z-index:10000; width:min(380px,calc(100vw - 32px)); max-width:none; padding:8px; border:1px solid var(--border); background:var(--white); color:var(--ink); }
.meeting-photo-preview-thumb { width:100%; max-height:min(72vh,620px); object-fit:contain; margin:0 0 6px; background:var(--cream); }
.hover-preview.meeting-photo-preview b { display:block; padding:2px 4px; color:var(--wine); font-size:13px; }

/* Компактное окно задачи, два устойчивых столбца вместо сжимающихся полей. */
#modal-content.manual-task-modal-content { width:min(780px,calc(100vw - 32px)); max-width:780px; box-sizing:border-box; }
.manual-task-modal-content .manual-task-modal-grid { gap:14px; }
.manual-task-modal-content .manual-task-modal-meta { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; gap:12px; padding:14px; }
.manual-task-modal-content .manual-task-creator { display:grid; align-content:center; gap:4px; min-height:66px; padding:8px 10px; border-radius:8px; background:var(--white); }
.manual-task-modal-content .manual-task-creator b { color:var(--ink); }
.manual-task-modal-content .manual-task-observer-picker { grid-column:1/-1; }
.manual-task-modal-content .manual-task-due-picker { max-width:280px; }
.manual-task-modal-content .manual-task-modal-meta .field-row { position:relative; min-width:0; }
.manual-task-modal-content .manual-task-assignee-results { position:absolute; z-index:10020; top:calc(100% + 4px); left:0; right:0; max-height:230px; overflow:auto; padding:5px; border:1px solid var(--border); border-radius:8px; background:var(--white); box-shadow:0 8px 22px rgba(0,0,0,.16); }
.manual-task-modal-content .manual-task-assignee-results[hidden] { display:none; }
.manual-task-modal-content .manual-task-observer-chips { display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.manual-task-modal-content .manual-task-observer-chips button { padding:4px 8px; border:1px solid var(--border); border-radius:999px; background:var(--cream); color:var(--ink); font:inherit; font-size:12px; cursor:pointer; }
.manual-task-modal-content .actions-row { justify-content:flex-end; margin-top:2px; }
.tasks-lane-cards { min-width:0; }
.tasks-lane .task-card { display:block; box-sizing:border-box; width:100%; min-width:0; max-width:100%; }
.tasks-lane .task-card-title,.tasks-lane .task-card-content { min-width:0; overflow-wrap:anywhere; }
@media(max-width:650px) {
  .manual-task-modal-content .manual-task-modal-meta { grid-template-columns:minmax(0,1fr); }
  .manual-task-modal-content .manual-task-observer-picker { grid-column:auto; }
  .manual-task-modal-content .manual-task-due-picker { max-width:none; }
  #view-meeting .meeting-size-switch button,.tasks-size-switch button { padding:5px 9px; }
}
.role-modal-levels { display:flex; gap:5px; }
.role-modal-levels button { flex:1; min-width:0; padding:7px 5px; border:1px solid var(--border); border-radius:6px; font:inherit; font-size:12px; line-height:1.15; white-space:normal; cursor:pointer; }
.role-modal-levels button.selected { outline:2px solid var(--gold); outline-offset:1px; font-weight:700; }
.role-modal-levels button:disabled { opacity:.6; cursor:not-allowed; }
.users-role-modal-footer { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:14px; }
.products-page-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.products-page-heading .page-title { margin:0; }
.products-page-heading [hidden] { display:none!important; }
.meeting-topic-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 12px; }
.meeting-note-row-tools { display:flex; align-items:center; gap:8px; margin:5px 0; }
.meeting-note-edit { box-sizing:border-box; display:block; width:100%; min-height:54px; padding:8px 10px; border:1px solid var(--border); border-radius:7px; font:inherit; resize:vertical; }
.meeting-note-edit-actions { display:flex; gap:6px; margin-top:6px; }
.meeting-topic-modal-grid { display:grid; gap:14px; }
.meeting-topic-modal-grid .field-row { position:relative; display:grid; gap:6px; }
.meeting-topic-modal-grid input,.meeting-topic-modal-grid textarea { box-sizing:border-box; width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:9px; background:var(--cream); color:var(--ink); font:inherit; }
.meeting-topic-modal-grid textarea { resize:vertical; }
.meeting-topic-modal-results { position:absolute; z-index:100; top:72px; left:0; right:0; max-height:340px; overflow:auto; padding:5px; border:1px solid var(--border); border-radius:10px; background:var(--white); box-shadow:0 10px 28px rgba(0,0,0,.13); }
.meeting-topic-modal-results[hidden] { display:none; }
.meeting-topic-modal-grid [data-meeting-picked] { font-size:12px; }
/* Закреплённый столбец матрицы прав: внутренний контейнер — единственная горизонтальная прокрутка. */
.users-access-matrix-panel { display:block!important; box-sizing:border-box!important; width:100%!important; max-width:100%!important; min-width:0!important; overflow:visible!important; }
.users-access-matrix-panel .users-access-scroll { display:block!important; box-sizing:border-box!important; width:100%!important; min-width:0!important; max-width:100%!important; overflow-x:auto!important; overflow-y:auto!important; position:relative!important; }
.users-access-matrix-panel .users-access-editable { width:max-content!important; min-width:max(1050px,100%)!important; }
.users-access-matrix-panel .users-access-editable thead th:first-child,
.users-access-matrix-panel .users-access-editable tbody tr:not(.users-access-group) td:first-child,
.users-access-matrix-panel .users-access-editable tbody tr.users-access-group th { position:relative!important; left:auto!important; z-index:8!important; will-change:transform; }
.users-access-matrix-panel .users-access-editable thead th:first-child { z-index:10!important; background:#171717!important; }
.users-access-matrix-panel .users-access-editable tbody tr:not(.users-access-group) td:first-child { background:var(--white)!important; }
.users-access-matrix-panel .users-access-editable tbody tr.users-access-group th { background:#f4f0e7!important; }
.users-role-modal-manage { display:flex; flex-wrap:wrap; gap:6px; }
.users-role-modal-footer .actions-row { display:flex; gap:7px; margin:0; }
@media(max-width:850px){.users-matrix-heading{flex-direction:column}.users-role-toolbar{width:100%}.users-role-toolbar button{flex:1}.users-role-modal-footer{align-items:flex-start;flex-direction:column}.role-modal-levels{flex-wrap:wrap}.role-modal-levels button{flex:1 1 29%;}}
.users-access-overview th { position:sticky; top:0; background:#171717; color:#fff; text-align:center; }
.users-access-overview th:first-child,.users-access-overview td:first-child { text-align:left; }
.users-access-overview th small { display:block; margin-top:4px; color:var(--gold); font-weight:400; }
.user-role-picker { min-width:0; margin:12px 0; padding:12px; border:1px solid var(--border); border-radius:10px; }
.user-role-picker legend { padding:0 6px; color:var(--wine); font-size:14px; font-weight:700; }
.user-role-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:6px; }
.user-role-option { display:flex; align-items:flex-start; gap:8px; min-width:0; padding:8px 10px; border:1px solid #e7dfd0; border-radius:8px; background:#faf8f3; font-size:13px; line-height:1.3; }
.user-role-option input { flex:0 0 auto; margin:2px 0 0; }
.user-role-option span { overflow-wrap:anywhere; }
.legacy-user-role-note { margin:8px 0 0; padding:8px 10px; border-radius:7px; background:#f7f0df; color:#6f5b36; font-size:12px; line-height:1.4; }
.access-level { display:inline-block; padding:4px 7px; border-radius:999px; background:#f4e9e7; color:#973b32; white-space:nowrap; font-size:11px; }
.access-level.access-view { background:#f7f0df; color:#806334; }
.access-level.access-edit { background:#e5f2e8; color:#28633a; }
@media(max-width:850px){.users-role-layout{grid-template-columns:1fr}.users-role-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:6px}.users-role-list h3,.users-new-role{grid-column:1/-1}.users-role-card{margin:0}.users-role-title{flex-direction:column}.access-level-picker button{min-width:72px;padding:6px 5px}}

/* Компактные темы планёрки и быстрый поиск исполнителя задачи */
.meeting-note-row { align-items:flex-start; gap:9px; padding:9px 34px 9px 9px; margin:7px 0; position:relative; }
.meeting-note-content { min-width:0; flex:1; position:relative; }
.meeting-note-edit-trigger { display:block; max-width:calc(100% - 24px); padding:1px 0; border:0; background:transparent; color:var(--ink); text-align:left; font:inherit; line-height:1.4; cursor:pointer; overflow-wrap:anywhere; }
.meeting-note-edit-trigger:hover { color:var(--wine); text-decoration:underline; }
.meeting-note-delete { position:absolute; top:0; right:-24px; width:23px; height:23px; border:1px solid var(--border); border-radius:50%; background:#fff; color:#a33d34; font-size:17px; line-height:1; cursor:pointer; }
.meeting-note-action-row { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-top:7px; }
.meeting-note-action-row .btn { padding:4px 8px; font-size:11px; }
.meeting-note-resolution { margin-top:5px; padding:6px 8px; border-radius:6px; background:#eef5ed; color:#386445; font-size:12px; overflow-wrap:anywhere; }
.meeting-outcome-task { margin-top:5px; color:#6f5b36; font-size:11px; }
.meeting-note-resolve-form textarea { box-sizing:border-box; width:100%; min-height:58px; margin-top:5px; }
.meeting-note-resolve-form .actions-row { gap:5px; }
.tasks-nav-btn { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.tasks-nav-badge { display:inline-flex; min-width:20px; height:20px; align-items:center; justify-content:center; padding:0 5px; border-radius:999px; background:#a33d34; color:#fff; font-size:11px; font-weight:700; line-height:1; }
.tasks-nav-badge[hidden] { display:none; }
.manual-task-assignee-picker { position:relative; }
.manual-task-assignee-picker input[type="search"] { box-sizing:border-box; width:100%; min-width:0; padding:9px 10px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; }
.manual-task-assignee-results { position:absolute; z-index:120; top:calc(100% - 24px); left:0; right:0; max-height:230px; overflow:auto; padding:5px; border:1px solid var(--border); border-radius:8px; background:var(--white); box-shadow:0 8px 22px rgba(0,0,0,.14); }
.manual-task-assignee-results[hidden] { display:none; }
.manual-task-assignee-results button { display:block; width:100%; padding:8px 10px; border:0; border-radius:5px; background:transparent; color:var(--ink); text-align:left; font:inherit; cursor:pointer; }
.manual-task-assignee-results button:hover { background:var(--cream); }
@media(max-width:650px) { .meeting-note-row { padding-right:30px; } .meeting-note-delete { right:-21px; } }
.telegram-invite-box { display:grid; gap:8px; margin:12px 0; padding:12px; border:1px solid var(--border); border-radius:9px; background:var(--cream); }
.telegram-invite-boxes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0; }
.telegram-invite-boxes .telegram-invite-box { min-width:0; margin:0; align-content:start; }
.telegram-invite-boxes .telegram-invite-box .btn { background:var(--wine); border-color:var(--wine); color:#fff; }
.telegram-invite-boxes .telegram-invite-box p { margin:0; font-size:12px; line-height:1.35; }
@media(max-width:600px) { .telegram-invite-boxes { grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; } .telegram-invite-box { padding:8px!important; } .telegram-invite-box .btn { width:100%; padding:6px 5px; font-size:10px; white-space:normal; } .telegram-invite-box p { font-size:10px!important; } }
.telegram-invite-box input[data-invite-link] { box-sizing:border-box; width:100%; padding:9px 10px; border:1px solid var(--border); border-radius:7px; background:#fff; color:var(--ink); font:inherit; }
.telegram-invite-box small { color:#766e60; font-size:11px; line-height:1.4; }

/* Планёрка: кнопки, поиск и масштаб занимают одну компактную строку. */
#view-meeting .meeting-tools-row { display:grid; grid-template-columns:auto minmax(220px,1fr) auto; align-items:center; gap:9px; margin:8px 0 12px; }
#view-meeting .meeting-add-toolbar { max-width:none; margin:0; flex-wrap:nowrap; }
#view-meeting .meeting-add-toolbar .btn { white-space:nowrap; }
#view-meeting .meeting-tools-row > .search-input { box-sizing:border-box; width:100%; min-width:0; height:40px; margin:0; }
#view-meeting .meeting-size-switch { flex:0 0 auto; white-space:nowrap; }
#view-meeting .meeting-size-switch button { padding:7px 11px; }
#view-meeting .meeting-tools-row:not(:has(.meeting-add-toolbar)) { grid-template-columns:minmax(220px,1fr) auto auto; }

/* Масштаб «Мелко» в примерках — компактный размер карточек. */

/* Поиск работает отдельно в каждой колонке задач. */
.tasks-lane .task-lane-search { box-sizing:border-box; display:block; width:100%; max-width:none; min-width:0; height:38px; margin:0 0 8px; padding:8px 11px; border:1px solid var(--border); border-radius:10px; background:var(--white); color:var(--ink); font:inherit; font-size:13px; }
.tasks-lane .task-lane-search:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 2px color-mix(in srgb,var(--gold) 20%,transparent); }
.tasks-lane > h2 .task-lane-heading-title { min-width:0; flex:1; }
.tasks-lane > h2 .task-lane-heading-actions { display:inline-flex; align-items:center; gap:5px; }
.tasks-lane > h2 .task-lane-heading-actions [data-task-lane-count] { min-width:22px; padding:2px 7px; border-radius:999px; background:#eee9df; color:#655e51; text-align:center; font-size:11px; }
.task-lane-filter-button { flex:none; }
.task-filter-popover { width:min(320px,calc(100vw - 24px)); }
.task-filter-popover .kfp-title { font-size:12px; }
.task-filter-popover .kfp-sort { font-size:14px; padding:7px 9px; }
.task-filter-popover .task-filter-author { font-size:13px; padding:6px 10px; }
.task-filter-dates { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.task-filter-dates label { display:grid; min-width:0; gap:4px; color:var(--muted); font-size:12px; }
.task-filter-dates input { box-sizing:border-box; width:100%; min-width:0; height:36px; padding:5px 7px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; font-size:13px; }
.task-filter-dates input:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 2px color-mix(in srgb,var(--gold) 20%,transparent); }

/* Реестр деклараций и предварительная проверка в карточке товара. */
.declaration-page-actions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:12px 0 16px; }
.declaration-page-actions .muted { font-size:13px; }
.declaration-modal { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; padding:18px; background:rgba(20,18,16,.48); }
.declaration-modal[hidden] { display:none!important; }
.declaration-modal-card { box-sizing:border-box; width:min(960px,calc(100vw - 40px)); max-height:min(88vh,820px); overflow:auto; padding:28px; border:1px solid var(--border); border-radius:16px; background:var(--white); box-shadow:0 18px 60px rgba(0,0,0,.24); }
.declaration-modal-card > header,.declaration-modal-card > footer { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.declaration-modal-card h2 { margin:0; color:var(--wine); font-size:21px; }
.declaration-modal-card > footer { justify-content:flex-end; margin-top:22px; }
.declaration-modal-close { width:32px; height:32px; border:1px solid var(--border); border-radius:50%; background:var(--cream); color:var(--ink); font-size:22px; line-height:1; cursor:pointer; }
.declaration-file-picker { display:flex; align-items:center; gap:12px; min-width:0; min-height:48px; padding:6px 9px; border:1px solid var(--border); border-radius:10px; background:var(--white); color:var(--muted); }
.declaration-file-picker input { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; clip-path:inset(50%); }
.declaration-file-picker > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.declaration-file-picker .btn { flex:none; min-height:34px; padding:6px 12px; }
.declaration-modal-card > footer .btn { min-height:42px; padding:9px 16px; }
.declaration-upload-grid,.declaration-edit-grid,.declaration-profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:10px 0; }
.declaration-upload-grid label,.declaration-edit-grid label,.declaration-profile-grid label,.declaration-list-toolbar label { display:grid; gap:4px; min-width:0; color:var(--muted); font-size:13px; }
.declaration-upload-grid input,.declaration-upload-grid select,.declaration-edit-grid input,.declaration-edit-grid textarea,.declaration-profile-grid input,.declaration-list-toolbar select,.declaration-list-toolbar input,.declaration-review-box textarea { box-sizing:border-box; width:100%; min-width:0; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; }
.declaration-modal .declaration-upload-grid { grid-template-columns:repeat(2,minmax(0,1fr)); align-items:end; gap:16px 20px; margin:18px 0 10px; }
.declaration-modal .declaration-upload-grid > label { gap:7px; font-size:14px; }
.declaration-modal .declaration-upload-grid select { min-height:46px; border-radius:10px; }
.declaration-modal .declaration-upload-grid > label:nth-child(4) { grid-column:1/-1; }
.declaration-modal .declaration-file-picker { width:100%; box-sizing:border-box; }
.declaration-list-toolbar { display:grid; grid-template-columns:minmax(140px,200px) minmax(180px,260px) minmax(220px,1fr); gap:10px; align-items:end; margin:14px 0; }
.declaration-table-scroll { width:100%; overflow-x:auto; }
.declaration-table-minwidth { min-width:1100px; }
.declaration-table-head,.declaration-record-summary { display:grid; grid-template-columns:minmax(250px,1.7fr) minmax(100px,.7fr) minmax(135px,.9fr) minmax(100px,.7fr) minmax(180px,1fr) 100px minmax(125px,.8fr); align-items:center; gap:10px; }
.declaration-table-head { padding:8px 12px; border-bottom:1px solid var(--border); color:var(--muted); font-size:11px; font-weight:700; }
.declaration-list { display:grid; gap:5px; }
.declaration-record { border:1px solid var(--border); border-radius:8px; background:var(--white); overflow:hidden; }
.declaration-record-summary { min-height:42px; padding:5px 12px; cursor:pointer; list-style:none; font-size:12px; line-height:1.25; }
.declaration-record-summary::-webkit-details-marker { display:none; }
.declaration-record-summary::after { content:none; }
.declaration-record[open] > .declaration-record-summary { border-bottom:1px solid var(--border); }
.declaration-number { display:flex; align-items:center; gap:8px; min-width:0; }
.declaration-number strong { overflow-wrap:anywhere; color:var(--ink); font-size:12px; }
.declaration-chevron { flex:none; width:7px; height:7px; border-right:1.5px solid var(--muted); border-bottom:1.5px solid var(--muted); transform:rotate(-45deg); transition:transform .15s; }
.declaration-record[open] .declaration-chevron { transform:rotate(45deg); }
.declaration-record-summary > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.declaration-record-summary > .declaration-validity { font-variant-numeric:tabular-nums; }
.declaration-record-summary > .declaration-remaining { color:#625a4c; font-size:11px; font-weight:650; font-variant-numeric:tabular-nums; }
.declaration-expiry-yellow > summary { background:#fff8e6; box-shadow:inset 3px 0 #d49a2a; }
.declaration-expiry-red > summary { background:#fff0ee; box-shadow:inset 3px 0 #b74337; }
.declaration-expiry-legend { display:flex; flex-wrap:wrap; gap:12px; margin:0 0 7px; color:var(--muted); font-size:11px; }
.declaration-expiry-legend span { display:inline-flex; align-items:center; gap:5px; }
.declaration-expiry-legend i { width:9px; height:9px; border-radius:50%; }
.declaration-expiry-legend i.yellow { background:#d49a2a; }
.declaration-expiry-legend i.red { background:#b74337; }
.declaration-pdf-link { display:inline-flex; align-items:center; justify-content:center; min-height:28px; padding:4px 9px; border:1px solid #cfc7b9; border-radius:6px; background:#f7f4ed; color:#4e493f; font-size:11px; font-weight:650; text-decoration:none; white-space:nowrap; }
.declaration-pdf-link:hover { border-color:#a78a59; background:#efe9dc; color:#4e493f; }
.declaration-record-title > span,.declaration-record-counts,.declaration-record-meta { color:var(--muted); font-size:12px; }
.declaration-record-counts { white-space:nowrap; margin-left:auto; }
.declaration-record-body { padding:10px 12px 12px; }
.declaration-record-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.declaration-data-tables { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; align-items:start; }
.declaration-data-section { min-width:0; padding:10px; border:1px solid var(--border); border-radius:9px; background:color-mix(in srgb,var(--cream) 42%,var(--white)); }
.declaration-data-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.declaration-data-heading h4 { margin:0; font-size:14px; }
.declaration-data-table-wrap { max-height:340px; overflow:auto; }
.declaration-data-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:13px; }
.declaration-data-table th,.declaration-data-table td { padding:5px 6px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
.declaration-data-table th { position:sticky; top:0; z-index:1; color:var(--muted); background:var(--cream); font-weight:600; }
.declaration-data-table tbody tr:last-child td { border-bottom:0; }
.declaration-data-table input { box-sizing:border-box; width:100%; min-width:0; padding:6px 8px; border:1px solid var(--border); border-radius:6px; background:var(--white); color:var(--ink); font:inherit; }
.declaration-row-remove { width:28px; height:28px; border:0; border-radius:6px; background:transparent; color:var(--muted); font-size:18px; cursor:pointer; }
.declaration-row-remove:hover { background:#f8e7e4; color:#93382d; }
.declaration-edit { border-top:1px solid var(--border); padding-top:9px; margin-top:12px; }
.declaration-edit summary { cursor:pointer; font-weight:600; }
.declaration-record-actions { justify-content:flex-start; margin-top:12px; }
.declaration-edit-grid small { color:var(--muted); }
.declaration-edit .actions-row { justify-content:flex-start; margin-top:8px; }
.declaration-section-title { margin:14px 0 5px; color:var(--wine); font-size:14px; }
.declaration-meta-grid { grid-template-columns:repeat(4,minmax(150px,1fr)); gap:8px; margin:7px 0 10px; }
.declaration-list-field { display:grid; gap:4px; color:var(--muted); font-size:12px; }
.declaration-list-field textarea { box-sizing:border-box; width:100%; min-height:68px; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; font-size:13px; line-height:1.45; resize:vertical; }
.declaration-list-field textarea[data-dec-values="product_names"] { min-height:112px; }
.declaration-inline-section { margin:0 0 12px; }
.declaration-list-field { width:100%; }
.declaration-list-field textarea[data-dec-values="product_names"] { display:block; width:100%; min-height:62px; }
.declaration-inline-section .declaration-section-title { margin:7px 0 5px; }
.declaration-section-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.declaration-section-heading .declaration-section-title { margin:5px 0; }
.declaration-code-list { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
.declaration-code-chip { display:inline-flex; align-items:center; gap:3px; max-width:180px; padding:2px 4px 2px 8px; border:1px solid var(--border); border-radius:999px; background:var(--cream); }
.declaration-code-chip input { box-sizing:border-box; width:88px; max-width:130px; padding:3px 0; border:0; outline:0; background:transparent; color:var(--ink); font:inherit; font-size:12px; }
.declaration-code-chip button { width:20px; height:20px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted); font-size:16px; cursor:pointer; }
.declaration-code-chip button:hover { background:#f8e7e4; color:#93382d; }
.declaration-add-row { margin-top:6px; }
.declaration-composition-list { display:grid; gap:5px; }
.declaration-composition-row { display:flex; align-items:center; gap:6px; max-width:none; }
.declaration-composition-row input { box-sizing:border-box; flex:1; min-width:0; padding:7px 9px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; font-size:12px; }
.declaration-composition-note { display:block; margin-top:5px; color:var(--muted); font-size:11px; }
.declaration-product-context { padding:10px 12px; border-radius:9px; background:var(--cream); color:var(--ink); line-height:1.6; }
.declaration-profile-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.declaration-composition-field { grid-column:1/-1; }
.product-declarations-check h3 { margin:18px 0 8px; }
.product-declaration-candidates { display:grid; gap:8px; }
.product-declaration-candidate { padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--white); }
.product-declaration-candidate.selected { border-color:var(--wine); box-shadow:0 0 0 1px var(--wine); }
.product-declaration-choice { display:flex; align-items:center; gap:9px; cursor:pointer; }
.product-declaration-choice span { display:grid; gap:3px; }
.product-declaration-choice small { color:var(--muted); }
.declaration-match-flags { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; font-size:12px; }
.declaration-match-flags span { padding:3px 7px; border-radius:999px; background:var(--cream); color:var(--muted); }
.declaration-match-flags .declaration-match-ok { background:#e5f2e8; color:#24643e; }
.declaration-match-flags .declaration-match-bad { background:#f8e7e4; color:#93382d; }
.declaration-candidate-products { display:flex; flex-wrap:wrap; gap:5px; margin:7px 0; }
.declaration-candidate-products span { padding:3px 7px; border-radius:6px; background:var(--cream); font-size:12px; }
.declaration-candidate-products small { flex-basis:100%; color:var(--muted); }
.product-declaration-candidate > a { font-size:13px; }
.product-declaration-pdf { margin:12px 0; border:1px solid var(--border); border-radius:10px; overflow:hidden; }
.product-declaration-pdf summary { padding:9px 12px; cursor:pointer; font-weight:600; }
.product-declaration-pdf iframe { display:block; width:100%; height:min(70vh,760px); border:0; }
.declaration-review-box { display:grid; justify-items:start; gap:9px; margin-top:14px; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--cream); }
.declaration-review-box label { display:grid; width:100%; gap:5px; }
.declaration-review-box .actions-row { justify-content:flex-start; margin:0; }
.recurring-task-form { margin:12px 0 16px; padding:10px; overflow-x:auto; }
.recurring-task-form-grid { display:flex; flex-wrap:nowrap; gap:8px; align-items:end; min-width:max-content; }
.recurring-task-form-grid > label { display:grid; gap:3px; min-width:0; color:var(--muted); font-size:13px; white-space:nowrap; }
.recurring-task-form-grid input:not([type=checkbox]),.recurring-task-form-grid select { box-sizing:border-box; height:34px; min-width:0; padding:5px 8px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; font-size:14px; }
.recurring-task-form-title { width:92px; padding-bottom:9px; font-size:14px; white-space:nowrap; }
.recurring-task-form-grid > label:nth-of-type(1) input { width:175px; }
.recurring-task-form-grid > label:nth-of-type(2) select { width:145px; }
.recurring-task-form-grid > label:nth-of-type(3) select { width:142px; }
.recurring-task-inline-options { display:flex; align-items:end; min-width:125px; }
.recurring-task-inline-options > label { display:grid; gap:3px; color:var(--muted); font-size:13px; }
.recurring-task-inline-options select,.recurring-task-inline-options input { width:125px; }
.recurring-task-inline-options input[type=number] { width:78px; }
.recurring-no-extra { padding:0 8px 9px; color:var(--muted); font-size:12px; }
.recurring-task-form-grid .recurring-task-time input { width:90px; }
.recurring-task-form-grid .recurring-task-start input { width:125px; }
.recurring-task-form-grid .recurring-task-description input { width:180px; }
.recurring-task-compact-check { display:flex !important; align-items:center; gap:5px !important; height:34px; font-size:13px !important; }
.recurring-task-compact-check input { margin:0; }
.recurring-task-form-actions { display:flex; gap:4px; align-items:center; padding-bottom:1px; }
.recurring-task-form-message { align-self:center; max-width:190px; color:#9c332a; font-size:11px; }
.recurring-selected-date-control { display:flex; align-items:end; gap:5px; flex-wrap:wrap; max-width:320px; }
.recurring-selected-date-control label { display:grid; gap:3px; color:var(--muted); font-size:11px; }
.recurring-selected-date-control input { width:125px; }
.recurring-selected-date-control > div { display:flex; flex-wrap:wrap; gap:4px; max-width:150px; }
.recurring-date-chip { padding:3px 6px; border:1px solid var(--border); border-radius:999px; background:var(--cream); color:var(--ink); font-size:11px; cursor:pointer; }
.recurring-task-toolbar { margin:14px 0 10px; }
.task-settings-tabs { display:flex; width:max-content; max-width:100%; gap:4px; margin:0 0 14px; padding:4px; border:1px solid var(--border); border-radius:999px; background:var(--white); }
.task-settings-tabs button { padding:5px 10px; border:0; border-radius:999px; background:transparent; color:var(--ink); font:inherit; font-size:12px; line-height:1.3; cursor:pointer; }
.task-settings-tabs button.active { background:#171717; color:#fff; }
.task-settings-panel-heading { margin:0 0 12px; }
.task-settings-panel-heading h2 { margin:0 0 4px; color:var(--wine); }
.task-template-help { display:grid; gap:7px; margin:0 0 12px; font-size:12px; }
.stage-template-variables { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px 12px; max-width:1180px; }
.stage-template-variables > div { display:flex; align-items:baseline; gap:7px; min-width:0; }
.stage-template-variables code { flex:none; color:var(--wine); font:600 12px ui-monospace,SFMono-Regular,Menlo,monospace; }
.stage-template-variables span { color:var(--muted); }
.automatic-task-table-wrap { width:100%; overflow:auto; border:1px solid var(--border); border-radius:9px; background:var(--white); }
.automatic-task-table { width:100%; border-collapse:collapse; }
.automatic-task-table th { padding:5px 9px; background:#f8f5ee; color:#665c4d; font-size:11px; text-align:left; }
.automatic-task-table td { padding:0; border-top:1px solid var(--border); }
.automatic-task-row summary { display:block; min-height:0; padding:5px 9px; list-style:none; cursor:pointer; line-height:1.25; }
.automatic-task-row summary::-webkit-details-marker { display:none; }
.automatic-task-row summary::after { content:none; }
.automatic-task-row[open] summary { border-bottom:1px solid var(--border); background:#fbfaf6; }
.automatic-task-stage-name { font-weight:600; font-size:12px; }
.automatic-task-row-hint { color:var(--muted); font-size:12px; }
.automatic-task-stage-body { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 14px; padding:12px; }
.automatic-task-stage-body > label { display:grid; gap:5px; color:var(--muted); font-size:12px; }
.automatic-task-stage-body input,.automatic-task-stage-body textarea { box-sizing:border-box; width:100%; min-width:0; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; }
.automatic-task-stage-body textarea { resize:vertical; }
.automatic-task-stage-actions { display:flex; grid-column:1/-1; align-items:center; gap:10px; }
.automatic-stage-observers { position:relative; display:grid; gap:5px; min-width:0; color:var(--muted); font-size:12px; }
.automatic-stage-observers .recurring-picker { position:relative; }
.stage-task-preview { margin:10px 0 14px; padding:12px 14px; border:1px solid var(--border); border-radius:9px; background:#f8f5ee; }
.stage-task-preview b { color:var(--wine); }
.stage-task-preview p { margin:6px 0 0; white-space:pre-wrap; }
.recurring-picker-field { display:grid; gap:5px; color:var(--muted); font-size:13px; }
.recurring-picker { position:relative; display:grid; gap:6px; }
.recurring-picker > input { width:100%; }
.recurring-picker-selected { display:flex; flex-wrap:wrap; gap:5px; }
.recurring-selection-chip { display:inline-flex; align-items:center; gap:5px; padding:4px 8px; border-radius:999px; background:#f2ead9; color:var(--ink); font-size:12px; }
.recurring-selection-chip button { width:16px; height:16px; padding:0; border:0; border-radius:50%; background:rgba(0,0,0,.1); color:var(--ink); line-height:15px; cursor:pointer; }
.recurring-picker-results { position:absolute; z-index:170; top:calc(100% + 3px); left:0; right:0; display:grid; max-height:180px; overflow:auto; padding:5px; border:1px solid var(--border); border-radius:8px; background:var(--white); box-shadow:0 8px 20px rgba(0,0,0,.14); }
.recurring-task-modal .recurring-picker-results { position:fixed; z-index:5000; right:auto; }
.stage-picker-results { position:fixed; z-index:5000; right:auto; }
.recurring-picker-results[hidden] { display:none !important; }
.recurring-picker-results button { padding:7px 9px; border:0; border-radius:5px; background:transparent; color:var(--ink); text-align:left; font:inherit; cursor:pointer; }
.recurring-picker-results button:hover { background:var(--cream); }
.recurring-picker-empty { padding:7px 9px; color:var(--muted); font-size:12px; }
.recurring-file-check { display:grid; gap:7px; }
.recurring-file-toggle { display:flex; align-items:center; gap:6px; color:var(--ink); font-size:13px; }
.recurring-file-control { display:flex; align-items:center; gap:9px; }
.recurring-file-control[hidden] { display:none !important; }
.recurring-file-button { padding:7px 11px; border:1px solid var(--border); border-radius:8px; background:var(--cream); color:var(--ink); font:inherit; font-size:12px; cursor:pointer; }
.recurring-file-button:hover { border-color:var(--gold); background:#f8f2e6; }
.fitting-extra-owner-picker { min-width:0; }
.fitting-extra-owner-picker select[hidden] { display:none !important; }
.recurring-task-toolbar .search-pill { min-width:min(360px,100%); }
.recurring-task-toolbar .search-pill input { width:min(360px,55vw); }
.recurring-task-toolbar label.filter-pill { display:inline-flex; margin:0; color:var(--ink); }
.recurring-task-toolbar .filter-pill select { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.recurring-task-list { display:grid; gap:7px; }
.recurring-task-row { display:grid; grid-template-columns:minmax(220px,1fr) minmax(190px,.65fr) auto; gap:14px; align-items:center; padding:11px 13px; border:1px solid var(--border); border-radius:9px; background:var(--white); }
.recurring-task-row.paused { opacity:.72; }
.recurring-task-main,.recurring-task-meta { display:grid; gap:3px; min-width:0; }
.recurring-task-main > span,.recurring-task-main > small,.recurring-task-meta > span,.recurring-task-meta > small { color:var(--muted); font-size:12px; }
.recurring-task-main > small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recurring-task-actions { display:flex; flex-wrap:wrap; gap:6px; justify-content:flex-end; }
.recurring-task-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.recurring-task-heading .settings-intro { margin:0 0 12px; }
.recurring-task-table-wrap { overflow:auto; border:1px solid var(--border); border-radius:10px; background:var(--white); }
.recurring-task-table { width:100%; min-width:920px; border-collapse:collapse; }
.recurring-task-table th,.recurring-task-table td { padding:10px 11px; border-bottom:1px solid #eee8dd; text-align:left; vertical-align:top; }
.recurring-task-table th { background:#f8f5ee; color:#665c4d; font-size:12px; white-space:nowrap; }
.recurring-task-table td { font-size:13px; }
.recurring-task-table tr:last-child td { border-bottom:0; }
.recurring-task-table td small { display:block; margin-top:4px; color:var(--muted); line-height:1.4; }
.recurring-row-actions { display:flex; flex-wrap:wrap; gap:5px; }
.recurring-row-actions .btn { min-height:28px; padding:4px 9px; border-radius:7px; font-weight:600; white-space:nowrap; }
.recurring-row-actions .btn:not(.primary):not(.danger):hover { border-color:var(--gold); background:#f8f5ee; }
.recurring-row-actions .btn.primary:hover,.recurring-row-actions .btn.danger:hover { filter:brightness(.94); }
.recurring-task-modal { position:relative; max-width:820px; }
[data-rec-modal] { position:fixed!important; inset:0!important; z-index:14000!important; display:flex; align-items:center; justify-content:center; overflow:auto; padding:16px; box-sizing:border-box; }
[data-rec-modal] .recurring-task-modal { width:min(820px,100%); max-height:calc(100dvh - 32px); overflow:auto; box-sizing:border-box; }
.recurring-task-modal[hidden], [data-rec-modal][hidden] { display:none !important; }
.recurring-task-modal h2 { padding-right:36px; }
.recurring-task-modal-close { position:absolute; top:12px; right:14px; width:auto; height:auto; padding:2px 5px; border:0; border-radius:0; background:transparent; color:var(--ink); font:400 28px/1 Arial,sans-serif; cursor:pointer; }
.recurring-task-modal-close:hover { color:var(--wine); transform:scale(1.12); }
.recurring-modal-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.recurring-modal-grid > label { display:grid; min-width:0; gap:5px; color:var(--muted); font-size:13px; }
.recurring-modal-grid > label.wide,.recurring-choice-list.wide { grid-column:1/-1; }
.recurring-modal-grid input:not([type=checkbox]),.recurring-modal-grid select,.recurring-modal-grid textarea { box-sizing:border-box; width:100%; min-width:0; padding:9px 10px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; }
.recurring-modal-grid textarea { resize:vertical; }
.recurring-choice-list { min-width:0; margin:0; padding:9px 11px; border:1px solid var(--border); border-radius:9px; }
.recurring-choice-list legend { padding:0 5px; color:var(--muted); font-size:13px; }
.recurring-role-list,.recurring-employee-list { display:flex; flex-wrap:wrap; gap:7px 14px; max-height:145px; margin-top:7px; overflow:auto; }
.recurring-role-list label,.recurring-employee-list label,.recurring-check,.recurring-file-check > span { display:flex !important; align-items:center; gap:6px !important; color:var(--ink) !important; font-size:13px !important; }
.recurring-role-list input,.recurring-employee-list input,.recurring-check input,.recurring-file-check input { width:auto !important; }
.recurring-modal-grid .recurring-check { display:flex; align-self:end; min-height:39px; }
.recurring-form-message { min-height:18px; color:#9c332a; font-size:13px; }
.recurring-task-modal footer { display:flex; justify-content:flex-end; gap:8px; }
.recurring-selected-date-control { display:grid; align-content:start; gap:7px; }
.recurring-selected-date-control label { display:grid; gap:4px; color:var(--muted); font-size:13px; }
.fitting-additional-table td > small { display:block; margin-top:5px; }
.manual-task-product-picker { position:relative; display:grid; gap:5px; }
.manual-task-product-picker input[type="search"] { box-sizing:border-box; width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:8px; background:var(--cream); color:var(--ink); font:inherit; }
.manual-task-product-picker small,.manual-task-selected-product { color:var(--muted); font-size:13px; }
.manual-task-selected-product { padding:8px 10px; border-radius:8px; background:var(--cream); }
.manual-task-product-picker [data-manual-product-picked] button { margin-left:8px; border:0; background:none; color:var(--wine); cursor:pointer; font:inherit; }
.manual-task-product-picker .manual-task-assignee-results { top:calc(100% - 22px); }
@media (max-width:1100px) {
  .declaration-data-tables { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .declaration-data-section:last-child { grid-column:1/-1; }
  .recurring-task-form-grid { min-width:max-content; }
}
@media (max-width:720px) {
  .declaration-data-tables { grid-template-columns:minmax(0,1fr); }
  .declaration-data-section:last-child { grid-column:auto; }
  .declaration-record-summary { align-items:flex-start; flex-wrap:wrap; }
  .declaration-record-counts { margin-left:0; }
  .declaration-record-toolbar { align-items:flex-start; flex-direction:column; }
  .recurring-task-form-grid { min-width:max-content; }
  .recurring-task-heading { align-items:flex-start; flex-direction:column; }
  .task-settings-tabs { width:100%; }
  .task-settings-tabs button { flex:1; padding:5px 7px; font-size:11px; }
  .automatic-task-table-wrap { width:100%; }
  .stage-template-variables { grid-template-columns:minmax(0,1fr); }
  .automatic-task-row summary { padding:5px 8px; }
  .automatic-task-row-hint { display:none; }
  .automatic-task-stage-body { grid-template-columns:minmax(0,1fr); }
  .automatic-task-stage-actions { grid-column:auto; align-items:flex-start; flex-direction:column; }
  .recurring-file-control { flex-wrap:wrap; }
  .recurring-modal-grid { grid-template-columns:minmax(0,1fr); }
  .recurring-modal-grid > label.wide,.recurring-choice-list.wide { grid-column:auto; }
  .recurring-task-modal { padding:18px; }
  .recurring-task-row { grid-template-columns:minmax(0,1fr); gap:8px; }
  .recurring-task-actions { justify-content:flex-start; }
}
.stage-planning-settings { margin:0 0 18px; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--cream); }
.stage-planning-settings h4 { margin:0 0 10px; }
.stage-planning-fields { display:flex; flex-wrap:wrap; align-items:end; gap:10px; }
.stage-planning-fields > label:not(.stage-declaration-toggle) { display:grid; gap:4px; min-width:180px; color:var(--muted); font-size:12px; }
.stage-planning-fields input:not([type=checkbox]),.stage-planning-fields select { height:36px; padding:0 10px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; }
.stage-planning-toggle,.stage-declaration-toggle { display:flex; align-items:center; gap:7px; min-height:36px; font-size:13px; }
.stage-declaration-toggle { max-width:360px; }
.stage-planning-fields > label[hidden] { display:none; }
.stage-planning-settings > small { display:block; margin-top:8px; }
.declaration-upload-grid { grid-template-columns:minmax(150px,1fr) minmax(180px,1.3fr) minmax(105px,.7fr) minmax(220px,1.4fr); gap:8px; align-items:end; }
.declaration-upload-grid input,.declaration-upload-grid select { height:36px; padding:5px 9px; border-radius:999px; font-size:13px; }
.declaration-list-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:14px 0; }
.declaration-list-toolbar label.filter-pill { display:inline-flex; }
.declaration-list-toolbar label.search-pill { display:flex; }
.declaration-factory-select { display:inline-block; min-width:min(420px,100%); margin:5px 0 0; padding:6px 28px 6px 10px; border:1px solid var(--border); border-radius:999px; background:var(--white); color:var(--ink); font:inherit; }
.task-rework-note { padding:9px 11px; margin:6px 0; border-radius:8px; border-left:3px solid var(--gold); background:#fff5df; }
.task-rework-form { display:grid; gap:8px; margin-top:12px; padding:10px; border:1px solid var(--border); border-radius:9px; background:var(--cream); }
.task-rework-form label { display:grid; gap:5px; font-size:13px; }
.task-rework-form textarea { width:100%; box-sizing:border-box; padding:8px 10px; border:1px solid var(--border); border-radius:8px; background:var(--white); font:inherit; }
.kanban-card.stage-overdue { border-color:#c54c40; background:#fff0ee; box-shadow:inset 3px 0 #c54c40; }
.kanban-overdue-badge { align-self:flex-start; padding:3px 7px; border-radius:999px; background:#f6d9d5; color:#8d271d; font-size:10px; font-weight:700; }
.tasks-filters { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; padding:0; border:0; background:transparent; }
.tasks-filters label.filter-pill { display:inline-flex; margin:0; color:var(--ink); }
.tasks-filters .task-date-pill { padding-right:12px; cursor:default; }
.tasks-filters .task-date-pill::after { display:none; }
.tasks-filters .task-date-pill input[type=date] { position:static; width:128px; min-height:0; height:100%; padding:0; border:0; border-radius:0; background:transparent; color:var(--ink); font:inherit; font-size:12px; }
.tasks-filters .task-date-pill input[type=date]:focus { outline:none; box-shadow:none; }
@media(max-width:900px) { .declaration-meta-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) { .declaration-upload-grid,.declaration-edit-grid,.declaration-profile-grid,.declaration-list-toolbar { grid-template-columns:1fr; } .declaration-modal .declaration-upload-grid { grid-template-columns:1fr; } .declaration-modal .declaration-upload-grid > label:nth-child(4) { grid-column:auto; } .declaration-meta-grid { grid-template-columns:1fr; } .declaration-composition-field { grid-column:auto; } .declaration-record header { flex-direction:column; } .declaration-record-summary { align-items:flex-start; flex-wrap:wrap; } .declaration-record-counts { margin-left:0; } .declaration-modal { padding:10px; } .declaration-modal-card { width:min(620px,calc(100vw - 20px)); padding:20px; } }

/* Компактная сверка декларации в карточке товара и единая строка текущего этапа. */
.product-declarations-check > .settings-intro { margin:0 0 8px; font-size:12px; }
.product-declarations-check .declaration-product-context { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:6px 10px; font-size:12px; line-height:1.35; }
.product-declarations-check .declaration-product-context > b { color:var(--wine); }
.product-declarations-check .declaration-check-grid { display:grid; grid-template-columns:minmax(190px,1.25fr) minmax(170px,1.2fr) minmax(110px,.72fr) minmax(170px,1.1fr) minmax(180px,1.25fr) auto; gap:8px; align-items:end; margin:10px 0 14px; }
.product-declarations-check .declaration-check-grid > label { display:grid; min-width:0; gap:4px; color:var(--muted); font-size:11px; font-weight:600; }
.product-declarations-check .declaration-check-grid input,.product-declarations-check .declaration-check-grid select { box-sizing:border-box; width:100%; min-width:0; height:36px; padding:6px 8px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; font-size:12px; }
.product-declarations-check .declaration-check-grid .declaration-confirm-button { min-height:36px; padding:7px 10px; font-size:11px; white-space:nowrap; }
.product-declarations-check h3 { margin:10px 0 7px; font-size:15px; }
.product-declaration-candidate { padding:9px 11px; }
.product-declaration-candidate .declaration-match-flags { margin:5px 0; }
.declaration-open-pdf { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; white-space:nowrap; }
.product-declaration-pdf { margin:10px 0; border:1px solid var(--border); border-radius:9px; overflow:hidden; background:var(--white); }
.product-declaration-pdf > header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border-bottom:1px solid var(--border); font-size:12px; }
.product-declaration-pdf iframe { display:block; width:100%; height:min(48vh,520px); border:0; }
.product-declaration-pdf-empty { margin:10px 0; padding:10px 12px; border:1px dashed var(--border); border-radius:8px; color:var(--muted); font-size:12px; }
.declaration-check-hint { display:block; margin:4px 0 0; font-size:11px; }
.declaration-no-factory { margin:6px 0; font-size:12px; }
.product-declarations-check .declaration-linked-factories { display:flex; flex-wrap:wrap; align-items:center; gap:7px; margin:8px 0; font-size:12px; }
.product-declarations-check .declaration-factory-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border:1px solid var(--border); border-radius:999px; background:var(--white); }
.product-declarations-check .declaration-factory-chip button { width:18px; height:18px; padding:0; border:0; border-radius:50%; background:#f4e7e4; color:var(--wine); font:inherit; font-size:14px; line-height:16px; cursor:pointer; }
.product-declarations-check .declaration-add-factory { display:inline-flex; align-items:center; gap:6px; color:var(--muted); }
.product-declarations-check .declaration-add-factory select { max-width:min(360px,70vw); min-height:32px; padding:5px 10px; border:1px solid var(--border); border-radius:999px; background:var(--white); color:var(--ink); font:inherit; font-size:12px; }
.product-declarations-check .declaration-selection-hint { margin:-4px 0 8px; font-size:11px; }
.product-stage-control { display:flex; flex-wrap:wrap; align-items:center; gap:10px 20px; margin:10px 0 18px; padding:11px 13px; border:1px solid var(--border); border-radius:10px; background:var(--white); }
.product-stage-current,.product-stage-responsible { display:flex; flex-wrap:wrap; align-items:center; gap:7px; min-width:0; }
.product-stage-current > span,.product-stage-responsible > span { color:var(--muted); font-size:12px; font-weight:600; }
.product-stage-responsible > b { font-size:13px; }
.product-stage-control .stage-pill { padding:5px 10px; border:1px solid var(--border); border-radius:999px; font:inherit; font-size:12px; font-weight:700; cursor:pointer; }
.product-stage-control .btn { min-height:30px; padding:5px 10px; border-radius:7px; }
.product-stage-archive { margin-left:auto; }
.detail-delete-product { margin-left:auto; }
@media(max-width:1300px) {
  .product-declarations-check .declaration-check-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .product-declarations-check .declaration-confirm-button { justify-self:start; }
}
@media(max-width:760px) {
  .product-declarations-check .declaration-check-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .product-declarations-check .declaration-check-grid > label:nth-child(5) { grid-column:1/-1; }
  .product-declarations-check .declaration-product-context { align-items:flex-start; flex-direction:column; }
  .product-declaration-pdf > header { align-items:flex-start; flex-direction:column; }
  .product-stage-control { align-items:flex-start; flex-direction:column; gap:9px; }
  .product-stage-archive,.detail-delete-product { margin-left:0; }
}

/* Единая повестка: редактируемые даты и темы без отдельного экрана и скачка страницы. */
#view-meeting .meeting-agenda-day h2 button { padding:0; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; }
#view-meeting .meeting-agenda-day h2 button:hover { color:var(--wine); }
#view-meeting .meeting-agenda-inline-date,#view-meeting .meeting-day-inline-date { min-width:112px; padding:3px 6px; border:1px solid var(--gold); border-radius:6px; background:#fff; color:var(--text); font:inherit; font-size:12px; }
#view-meeting .meeting-agenda-inline-edit { width:100%; min-width:0; padding:4px 7px; border:1px solid var(--gold); border-radius:6px; background:#fff; color:var(--text); font:inherit; font-size:13px; }
#view-meeting .meeting-agenda-date { padding:2px 4px; border:0; border-radius:5px; background:transparent; cursor:pointer; }
#view-meeting .meeting-agenda-date:hover { background:#f5f0e5; color:var(--wine); }
#view-meeting .meeting-agenda-product-picker { position:relative; min-width:0; }
#view-meeting .meeting-agenda-product-picker [data-meeting-product-search] { width:100%; }
#view-meeting .meeting-agenda-product-results { top:calc(100% + 3px); left:0; width:min(360px,75vw); margin:0; }
#view-meeting .meeting-agenda-product-results button { align-items:center; min-height:52px; }
#view-meeting .meeting-agenda-product-results img,#view-meeting .meeting-agenda-product-results .meeting-add-empty-photo { flex:none; width:36px; height:44px; border-radius:5px; object-fit:cover; background:#f1eee6; }
#view-meeting .meeting-agenda-product-results button > span:last-child { display:grid; gap:2px; }
#view-meeting .meeting-agenda-product-results small { color:#817968; }
#view-meeting .meeting-agenda-picked { display:inline-flex; align-items:center; gap:6px; padding:3px 8px; border-radius:999px; background:#f2eddf; }
#view-meeting .meeting-agenda-picked img { width:23px; height:27px; border-radius:4px; object-fit:cover; }
#view-meeting .meeting-agenda-picked b { color:var(--wine); }
#view-meeting .meeting-agenda-article { cursor:default; }
#view-meeting .meeting-agenda-compose { grid-template-columns:150px minmax(220px,1fr) auto auto minmax(180px,260px) auto; }
@media(max-width:900px) { #view-meeting .meeting-agenda-compose .meeting-agenda-product-picker { grid-column:2/4; } }
@media(max-width:620px) { #view-meeting .meeting-agenda-compose .meeting-agenda-product-picker { grid-column:1/-1; } }
@media(max-width:460px) { .product-declarations-check .declaration-check-grid { grid-template-columns:minmax(0,1fr); } .product-declarations-check .declaration-check-grid > label:nth-child(5) { grid-column:auto; } }

/* Автор задачи — такое же понятное выбираемое поле, как исполнитель. */
.manual-task-modal-content .manual-task-creator-picker { min-width:0; }
.manual-task-modal-content .manual-task-creator-picker input[type="search"] { box-sizing:border-box; width:100%; min-width:0; padding:9px 10px; border:1px solid var(--border); border-radius:8px; background:var(--white); color:var(--ink); font:inherit; }
.manual-task-linked-product-value { display:flex; align-items:center; gap:8px; min-height:38px; padding:6px 9px; border:1px solid var(--border); border-radius:8px; background:#f7f4ec; }
.manual-task-linked-product-value img { width:28px; height:34px; border-radius:5px; object-fit:cover; }
.manual-task-linked-product-value span { display:grid; gap:2px; }
.manual-task-linked-product-value small { color:#817968; }
/* Общие состояния интерфейса: мягкая обратная связь без изменения поведения экранов. */
:root {
  --crm-motion-fast: 160ms;
  --crm-motion: 220ms;
  --crm-ease: cubic-bezier(.2,.75,.25,1);
  --crm-focus-ring: 0 0 0 3px color-mix(in srgb,var(--gold) 25%,transparent);
}

button,a,[role="button"],summary,.filter-pill,.ms-btn,.tasks-tabs button,.product-tabs button,
.task-status-pill,.meeting-agenda-status,.meeting-agenda-article,.fitting-responsibility-link {
  -webkit-tap-highlight-color:transparent;
  transition:color var(--crm-motion-fast) ease,background-color var(--crm-motion-fast) ease,
    border-color var(--crm-motion-fast) ease,box-shadow var(--crm-motion) ease,
    transform var(--crm-motion) var(--crm-ease),opacity var(--crm-motion-fast) ease;
}

:where(button,a,[role="button"],summary,.filter-pill,.ms-btn,.tasks-tabs button,.product-tabs button):focus-visible {
  outline:2px solid var(--gold);
  outline-offset:2px;
  box-shadow:var(--crm-focus-ring);
}

:where(input:not([type="checkbox"]):not([type="radio"]),select,textarea):focus-visible {
  outline:0;
  border-color:var(--gold)!important;
  box-shadow:var(--crm-focus-ring);
}

:where(input,select,textarea)[aria-invalid="true"],:where(input,select,textarea).invalid {
  border-color:var(--danger)!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--danger) 15%,transparent);
}

button:disabled,.btn:disabled,[aria-disabled="true"] {
  cursor:not-allowed!important;
  opacity:.56;
  filter:saturate(.72);
  transform:none!important;
  box-shadow:none!important;
}

button[aria-busy="true"],.btn[aria-busy="true"] { cursor:progress; }
button[aria-busy="true"]::after,.btn[aria-busy="true"]::after {
  content:""; display:inline-block; width:1em; height:1em; margin-left:8px; vertical-align:-.16em;
  border:2px solid currentColor; border-right-color:transparent; border-radius:50%;
  animation:crm-ui-spin .7s linear infinite;
}
@keyframes crm-ui-spin { to { transform:rotate(360deg); } }

.view.active { animation:crm-view-enter 240ms var(--crm-ease) both; }
@keyframes crm-view-enter { from { opacity:.65; translate:0 5px; } to { opacity:1; translate:0 0; } }

.product-tab-panel,.modal-content,.settings-tiles,.meeting-agenda-list,.declaration-data-table,
.recurring-task-table,.tasks-lane,.product-detail-loading,.sizegrid-loading {
  transition:background-color var(--crm-motion) ease,border-color var(--crm-motion) ease,
    box-shadow var(--crm-motion) ease;
}
.modal-overlay:not(.hidden) .modal-content { animation:crm-dialog-enter 200ms var(--crm-ease) both; }
@keyframes crm-dialog-enter { from { opacity:.7; transform:translateY(7px) scale(.995); } to { opacity:1; transform:translateY(0) scale(1); } }

.table-scroll table tbody tr,.declaration-data-table tbody tr,.recurring-task-table tbody tr,
.users-access-editable tbody tr,.meeting-agenda-row {
  transition:background-color var(--crm-motion-fast) ease,box-shadow var(--crm-motion-fast) ease;
}
.table-scroll table tbody tr:hover,.declaration-data-table tbody tr:hover,
.recurring-task-table tbody tr:hover,.users-access-editable tbody tr:not(.users-access-group):hover,
.meeting-agenda-row:hover { background-color:color-mix(in srgb,var(--gold) 7%,var(--white)); }

.product-tab-panel img,.prod-item img,.kanban-thumb,.fitting-cover img,.fitting-photo-tile img,
.fitting-session-thumb,.row-thumb,.task-card img,.crm-preview-cards img {
  border-radius:var(--crm-card-radius,5px);
  transition:filter var(--crm-motion) ease,transform var(--crm-motion) var(--crm-ease);
}
.product-tab-panel img:hover,.fitting-photo-tile:hover img { filter:saturate(1.04); }

.tasks-tabs button:active,.product-tabs button:active,.filter-pill:active,.ms-btn:active,
.meeting-agenda-status:active,.meeting-agenda-article:active { transform:scale(.98); }
.tasks-tabs button.active,.product-tabs button.active,.filter-pill.on,.ms-btn.on {
  box-shadow:0 2px 8px color-mix(in srgb,var(--wine) 12%,transparent);
}

.loading-spinner { box-shadow:0 0 0 4px color-mix(in srgb,var(--gold) 10%,transparent); }
.sizegrid-loading,.fb-loading { background-image:linear-gradient(100deg,transparent 25%,rgba(255,255,255,.48) 45%,transparent 65%); background-size:220% 100%; animation:crm-loading-sheen 1.6s ease-in-out infinite; }
@keyframes crm-loading-sheen { to { background-position-x:-220%; } }
.skeleton { position:relative; overflow:hidden; border-radius:7px; background:#e9e4d9; color:transparent!important; }
.skeleton::after { position:absolute; inset:0; content:""; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent); animation:crm-loading-sheen 1.4s ease-in-out infinite; }

@media (hover:hover) and (pointer:fine) {
  .btn:not(:disabled):hover,.sidebar .nav-item:not(.active):hover,.product-tabs button:not(.active):hover,
  .tasks-tabs button:not(.active):hover { box-shadow:0 4px 12px rgba(23,23,23,.10); }
  .task-card:hover,.declaration-data-table tr:hover td,.recurring-task-table tr:hover td { box-shadow:inset 0 0 0 999px rgba(159,129,81,.025); }
}

@media(max-width:700px) {
  .view.active { animation-duration:180ms; }
  .modal-overlay:not(.hidden) .modal-content { animation-duration:180ms; }
  .table-scroll table tbody tr:hover,.declaration-data-table tbody tr:hover,
  .recurring-task-table tbody tr:hover,.meeting-agenda-row:hover { background-color:inherit; }
}
@media (hover:none) {
  .btn:hover,.nav-item:hover,.settings-tile:hover,.kanban-card:hover,.prod-item:hover,
  .fitting-product-card:hover,.crm-logo-choice:hover { transform:none; box-shadow:none; }
}
@media(max-width:900px) {
  #view-meeting .meeting-tools-row { grid-template-columns:minmax(0,1fr) auto auto; }
  #view-meeting .meeting-add-toolbar { grid-column:1/-1; flex-wrap:wrap; }
}
@media(max-width:650px) {
  #view-meeting .meeting-tools-row { grid-template-columns:1fr; }
  #view-meeting .meeting-add-toolbar { grid-column:auto; }
  #view-meeting .meeting-size-switch { justify-self:start; }
  .fitting-view-small .fitting-cover { width:64px; height:78px; }
  .fitting-view-medium .fitting-cover { width:170px; height:208px; }
  .fitting-view-large .fitting-cover { width:210px; height:258px; }
}

/* All site controls use the regular-text font selected in CRM Style. */
button, input[type="button"], input[type="submit"], input[type="reset"], [role="button"], .btn {
  font-family: var(--crm-font-body, 'Roboto', 'Roboto Condensed', system-ui, sans-serif) !important;
}

.fitting-entry-history > summary svg { width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.fitting-task-create { display:grid; gap:5px; min-width:0; }
.fitting-task-create-button { min-height:32px; padding:5px 8px; white-space:nowrap; }
.fitting-task-create select { width:100%; min-height:34px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; }
.fitting-checklist-owner-label { color:#756b58; font-size:11px; overflow-wrap:anywhere; }
.fitting-task-detail-section { display:grid; gap:5px; padding-top:7px; border-top:1px solid var(--border); }
.fitting-task-comment,.fitting-task-history-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; padding:6px 7px; border-radius:7px; background:#f8f6f0; }
.fitting-task-comment p,.fitting-task-history-item p { grid-column:1/-1; margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.fitting-task-comment small,.fitting-task-history-item small { color:#817866; }
.fitting-task-comment-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:end; }
.fitting-task-comment-form textarea { min-width:0; padding:7px; border:1px solid var(--border); border-radius:7px; font:inherit; }
.task-fitting-notes { display:grid; gap:7px; padding-top:8px; border-top:1px solid var(--border); }
.task-fitting-notes h3 { margin:0; font-size:13px; }
.tasks-mobile-lanes { display:none; }

@media (max-width: 760px) {
  html,body { width:100%; max-width:100%; overflow-x:hidden; }
  body { -webkit-text-size-adjust:100%; }
  #app-layout.layout { display:flex; flex-direction:column; min-height:100dvh; width:100%; overflow-x:clip; }
  #app-root,main { width:100%; min-width:0; max-width:100%; padding:12px 12px calc(86px + env(safe-area-inset-bottom)); order:1; overflow-x:clip; }
  .sidebar,#app-layout > .sidebar { position:fixed!important; z-index:150; inset:auto 0 0; display:flex!important; flex-direction:row!important; align-items:center; gap:0; width:100%!important; height:calc(62px + env(safe-area-inset-bottom)); min-height:62px; padding:0 4px env(safe-area-inset-bottom); overflow-x:auto; overflow-y:hidden; white-space:nowrap; border-top:1px solid rgba(255,255,255,.18); box-shadow:0 -5px 18px rgba(0,0,0,.17); }
  .sidebar-title,.sidebar-user { display:none!important; }
  .sidebar .nav-menu { display:contents!important; }
  .sidebar .nav-item,.sidebar > a.nav-item { display:inline-flex!important; align-items:center; justify-content:center; flex:0 0 auto; width:auto; min-width:74px; max-width:112px; height:50px; margin:0 2px; padding:7px 9px; border-radius:10px; font-size:11px; line-height:1.2; text-align:center; white-space:normal; }
  .sidebar .nav-item[hidden] { display:none!important; }
  .sidebar .tasks-nav-btn { position:relative; }
  .sidebar .tasks-nav-badge { position:absolute; top:0; right:1px; }
  .view,.view.active { width:100%; min-width:0; max-width:100%; }
  h1.page-title { font-size:20px; line-height:1.2; overflow-wrap:anywhere; }
  .page-title,.section-title { max-width:100%; }
  button,.btn,input,select,textarea,[role="button"] { font-size:16px; }
  button,.btn,[role="button"] { min-height:42px; touch-action:manipulation; }
  .btn.small { min-height:38px; padding:7px 10px; font-size:14px; }
  input,select,textarea { max-width:100%; min-height:42px; }
  textarea { resize:vertical; }
  .btn,.nav-item,.fitting-responsibility-link { overflow-wrap:anywhere; }
  .products-page-heading,.fitting-session-header,.tasks-heading,.detail-header,.meeting-header { align-items:flex-start; flex-wrap:wrap; gap:9px; }
  .products-page-heading > *, .detail-header > * { min-width:0; }
  .filter-pills,.products-filters,.fitting-list-controls,.fitting-sort-controls,.fitting-view-group,.tasks-toolbar { display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; }
  .filter-pill,.tasks-tabs,.tasks-size-switch { min-width:0; max-width:100%; }
  .filter-pill input,.filter-pill select { width:100%; }
  .search-input,.fitting-search,.products-search { width:100%; min-width:0; }
  .modal-overlay { align-items:flex-end!important; padding:0!important; }
  .modal-content { width:100%!important; max-width:none!important; max-height:92dvh!important; margin:0!important; padding:16px 14px calc(16px + env(safe-area-inset-bottom))!important; overflow:auto; border-radius:18px 18px 0 0!important; overscroll-behavior:contain; }
  .modal-content input,.modal-content select,.modal-content textarea { width:100%; min-width:0; }
  .product-tabs { gap:5px; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; }
  .product-tabs button { flex:0 0 auto; min-height:42px; }
  .fitting-product-card,.product-fitting-entry,.task-card,.meeting-thread-card,.kanban-card { max-width:100%; min-width:0; }
  .fitting-product-head { display:grid!important; grid-template-columns:58px minmax(0,1fr) auto; gap:8px; align-items:center; padding:10px!important; }
  .fitting-product-identity { grid-column:1/3; min-width:0; }
  .fitting-cover { width:52px!important; height:68px!important; }
  .fitting-product-title,.fitting-product-identity span,.fitting-meta { overflow-wrap:anywhere; }
  .fitting-meta { grid-column:1/-1; text-align:left!important; font-size:12px; }
  .fitting-product-head > .btn,.fitting-product-head > .muted { grid-column:1/3; }
  .fitting-collapse-arrow { grid-column:3; grid-row:1; }
  .fitting-card-body { padding:8px!important; }
  .fitting-prices { display:grid!important; grid-template-columns:1fr; gap:8px; }
  .fitting-additional-form,.product-fitting-additional-form { display:grid!important; grid-template-columns:1fr!important; gap:8px; }
  .fitting-additional-form textarea { min-height:76px; }
  .fitting-detail > summary { min-height:48px; padding:10px 12px!important; line-height:1.35; }
  .fitting-additional-table-wrap,.fitting-checklist-table-scroll,.table-scroll { width:100%; max-width:100%; overflow:visible!important; }
  .fitting-checklist-table,.product-fitting-checklist-table,.fitting-additional-table { display:block; width:100%!important; min-width:0!important; table-layout:auto!important; }
  .fitting-checklist-table thead,.product-fitting-checklist-table thead,.fitting-additional-table thead { display:none!important; }
  .fitting-checklist-table tbody,.product-fitting-checklist-table tbody,.fitting-additional-table tbody { display:grid; gap:9px; width:100%; }
  .fitting-checklist-table tr.fitting-checklist-entry,.product-fitting-checklist-table tr.fitting-checklist-entry,.fitting-additional-table tr { display:grid!important; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"item item" "result result" "comment comment" "owner owner" "task history"; gap:5px 8px; width:100%; padding:10px; border:1px solid var(--border); border-radius:12px; background:var(--white); }
  .fitting-checklist-table td,.product-fitting-checklist-table td,.fitting-additional-table td { display:block!important; width:auto!important; min-width:0; padding:3px!important; border:0!important; text-align:left!important; overflow-wrap:anywhere; }
  .fitting-checklist-table .fitting-checklist-item-text,.product-fitting-checklist-table .fitting-checklist-item-text { grid-area:item; font-size:14px; font-weight:600; }
  .fitting-checklist-table .fitting-checklist-result,.product-fitting-checklist-table .fitting-checklist-result { grid-area:result; text-align:left!important; }
  .fitting-checklist-table tr > td:nth-child(3),.product-fitting-checklist-table tr > td:nth-child(3) { grid-area:comment; }
  .fitting-checklist-table tr > td:nth-child(4),.product-fitting-checklist-table tr > td:nth-child(4) { grid-area:owner; }
  .fitting-checklist-table tr > td:nth-child(5),.product-fitting-checklist-table tr > td:nth-child(5) { grid-area:task; }
  .fitting-checklist-table tr > td:nth-child(6),.product-fitting-checklist-table tr > td:nth-child(6) { grid-area:history; justify-self:end; align-self:end; }
  .fitting-checklist-table .fitting-checklist-number { display:inline; }
  .fitting-checklist-table textarea,.product-fitting-checklist-table textarea { min-height:54px!important; height:auto!important; font-size:15px!important; }
  .fitting-checklist-table .fitting-checklist-decisions button { min-width:44px; min-height:44px; }
  .fitting-additional-table tr > td:nth-child(1) { grid-area:item; }
  .fitting-additional-table tr > td:nth-child(2) { grid-area:owner; color:#756b58; font-size:13px; }
  .fitting-additional-table tr > td:nth-child(3) { grid-area:task; }
  .fitting-additional-table tr > td:nth-child(4) { grid-area:history; justify-self:end; align-self:end; }
  .fitting-additional-table tr > td:nth-child(5) { position:absolute; top:6px; right:6px; }
  .fitting-additional-table tr { position:relative; padding-right:38px; }
  .fitting-additional-table td small { display:block; margin-top:5px; line-height:1.35; overflow-wrap:anywhere; }
  .fitting-entry-task-popover,.fitting-entry-history > div { width:min(360px,calc(100vw - 24px)); max-height:65dvh; overflow:auto; font-size:14px; }
  .fitting-entry-history > summary { min-width:38px; min-height:38px; }
  .fitting-task-create-button { width:100%; white-space:normal; }
  .fitting-task-comment-form { grid-template-columns:1fr; }
  .fitting-task-comment-form button { width:100%; }
  .fitting-size-table-wrap,.fitting-size-grid-scroll { max-width:100%; overflow-x:auto!important; overscroll-behavior-x:contain; }
  .fitting-size-table { min-width:720px; }
  .mobile-card-table { display:block; width:100%!important; min-width:0!important; table-layout:auto!important; }
  .mobile-card-table thead { display:none!important; }
  .mobile-card-table tbody { display:grid; gap:8px; }
  .mobile-card-table tbody tr { display:grid; grid-template-columns:minmax(86px,34%) minmax(0,1fr); gap:5px 8px; padding:10px; border:1px solid var(--border); border-radius:11px; background:var(--white); }
  .mobile-card-table tbody td { display:grid; grid-template-columns:subgrid; grid-column:1/-1; grid-template-columns:minmax(86px,34%) minmax(0,1fr); gap:8px; width:auto!important; min-width:0; padding:3px 0!important; border:0!important; overflow-wrap:anywhere; }
  .mobile-card-table tbody td::before { content:attr(data-mobile-label); color:#827863; font-size:11px; line-height:1.3; }
  .mobile-card-table input,.mobile-card-table select,.mobile-card-table textarea { width:100%; min-width:0; }
  .tasks-mobile-lanes { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; position:sticky; top:0; z-index:20; padding:5px 0 8px; background:var(--cream); }
  .tasks-mobile-lanes button { min-height:42px; padding:5px; border:1px solid var(--border); border-radius:9px; background:var(--white); color:var(--ink); font-size:12px; }
  .tasks-mobile-lanes button.active { background:var(--wine); border-color:var(--wine); color:#fff; }
  .tasks-board { display:block!important; overflow:visible!important; }
  .tasks-lane { display:none; width:100%; min-width:0; max-width:100%; }
  .tasks-lane.is-mobile-active { display:block; }
  .tasks-lane h2 { position:static; }
  .task-card-summary { grid-template-columns:minmax(0,1fr); gap:6px; padding:12px; }
  .task-card-content { padding:10px!important; }
  .task-card-meta { grid-template-columns:1fr!important; }
  .tasks-size-switch { width:100%; }
  .tasks-size-switch button { flex:1; }
  .product-fitting-entry > header { display:grid; grid-template-columns:1fr; gap:8px; }
  .product-fitting-entry > header small,.product-fitting-entry > header .fitting-issue-summary { justify-self:start; }
  .detail-header h1 { flex:1 1 100%; }
  .product-stage-control,.meeting-general-resolution-form { display:grid!important; grid-template-columns:1fr!important; }
  .lightbox-decision-actions { display:grid!important; grid-template-columns:1fr 1fr; max-height:40dvh; overflow:auto; }
  .crm-style-shortcut { position:fixed; top:8px; right:8px; z-index:120; }
}

@media(max-width:420px) {
  #app-root,main { padding-left:9px; padding-right:9px; }
  .sidebar .nav-item,.sidebar > a.nav-item { min-width:68px; font-size:10px; padding-inline:6px; }
  .fitting-product-head { grid-template-columns:48px minmax(0,1fr) auto; }
  .fitting-cover { width:44px!important; height:58px!important; }
  .mobile-card-table tbody tr { grid-template-columns:minmax(76px,31%) minmax(0,1fr); }
  .mobile-card-table tbody td { grid-template-columns:minmax(76px,31%) minmax(0,1fr); }
}

@media(max-width:760px) {
  .fitting-size-grid-scroll { overflow:visible!important; margin:0!important; }
  .fitting-size-table { display:block; width:100%!important; min-width:0!important; table-layout:auto!important; }
  .fitting-size-table thead { display:none!important; }
  .fitting-size-table tbody { display:grid; gap:9px; }
  .fitting-size-table tbody tr { display:grid; grid-template-columns:1fr 1fr; gap:5px 8px; padding:10px; border:1px solid var(--border); border-radius:10px; background:var(--white); }
  .fitting-size-table tbody td { display:grid; grid-template-columns:minmax(0,1fr); gap:3px; min-width:0; padding:5px 2px; border:0; white-space:normal; text-align:left; }
  .fitting-size-table tbody td::before { content:attr(data-mobile-label); color:#817866; font-size:11px; line-height:1.25; }
  .fitting-size-table tbody td:first-child { grid-column:1/-1; font-size:16px; font-weight:700; color:var(--wine); }
  .fitting-size-table .sizegrid-qc-col { grid-column:1/-1; }
  .fitting-size-table .fit-measure-input { width:100%; min-width:0; min-height:42px; text-align:left; }
  .users-access-scroll,.users-role-matrix-scroll { overflow:visible!important; }
}

/* Keep checklist actions in the requested order and render task creation as a compact status chip. */
.fitting-task-create { display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-width:0; }
.fitting-task-create-button { display:inline-flex; align-items:center; justify-content:center; width:auto; min-width:0; min-height:28px!important; padding:4px 9px!important; border:1px solid rgba(116,88,33,.18)!important; border-radius:999px!important; background:#f5ead3!important; color:#745821!important; font:inherit; font-size:11px!important; font-weight:700; line-height:1.25; white-space:nowrap; box-shadow:none!important; }
.fitting-task-create-button:hover { background:#efdfbd!important; }
.fitting-checklist-table .fit-col-task { width:13%; }
.fitting-checklist-table .fit-col-area { width:20%; }
.fitting-additional-table th:nth-child(1) { width:48%; }
.fitting-additional-table th:nth-child(2),.fitting-additional-table th:nth-child(3) { width:20%; }
.fitting-additional-table th:nth-child(4) { width:12%; }
.fitting-additional-table td:last-child { width:auto; }

@media(max-width:760px) {
  body.mobile-filter-open { overflow:hidden; }
  /* A fixed app bar and drawer replace every personal desktop menu layout on phones. */
  #app-root,main { order:1!important; padding-top:64px!important; padding-bottom:18px!important; }
  #crm-menu-toggle { display:grid!important; place-items:center; position:fixed!important; z-index:162!important; top:10px!important; left:10px!important; width:46px!important; height:46px!important; min-height:46px!important; border:1px solid rgba(255,255,255,.22)!important; border-radius:13px!important; background:var(--wine)!important; color:#fff!important; box-shadow:0 4px 15px rgba(0,0,0,.22)!important; font-size:22px!important; }
  #crm-menu-backdrop { display:block; visibility:hidden; position:fixed!important; z-index:158!important; inset:0!important; width:100%!important; height:100%!important; opacity:0; background:rgba(20,17,15,.48)!important; transition:opacity .2s ease,visibility .2s ease; }
  body.crm-menu-open #crm-menu-backdrop { visibility:visible; opacity:1; }
  #app-layout > .sidebar,
  body[data-crm-menu-position="top"] #app-layout > .sidebar,
  body[data-crm-menu-position="bottom"] #app-layout > .sidebar,
  body[data-crm-menu-position="floating"] #app-layout > .sidebar { position:fixed!important; z-index:160!important; inset:0 auto 0 0!important; display:flex!important; flex-direction:column!important; align-items:stretch!important; gap:12px!important; width:min(320px,86vw)!important; height:100dvh!important; min-height:0!important; max-height:100dvh!important; padding:calc(68px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom))!important; overflow-x:hidden!important; overflow-y:auto!important; border:0!important; border-radius:0 18px 18px 0!important; box-shadow:8px 0 30px rgba(0,0,0,.25)!important; transform:translateX(-105%)!important; transition:transform .24s ease!important; }
  body.crm-menu-open #app-layout > .sidebar { transform:translateX(0)!important; }
  .sidebar-title { display:block!important; flex:0 0 auto!important; max-width:none!important; padding:8px 6px 12px!important; font-size:17px!important; }
  .sidebar .nav-menu { display:flex!important; flex:1 0 auto!important; flex-direction:column!important; align-items:stretch!important; justify-content:flex-start!important; flex-wrap:nowrap!important; gap:5px!important; min-width:0!important; overflow:visible!important; }
  .sidebar .nav-item,.sidebar > a.nav-item { display:flex!important; align-items:center!important; justify-content:flex-start!important; flex:0 0 auto!important; width:100%!important; max-width:none!important; min-width:0!important; min-height:48px!important; height:auto!important; margin:0!important; padding:12px 14px!important; border:1px solid transparent!important; border-radius:12px!important; font-size:15px!important; line-height:1.25!important; text-align:left!important; white-space:normal!important; }
  .sidebar .nav-item.active { background:var(--gold)!important; color:var(--sidebar-active-text,var(--ink))!important; border-color:rgba(0,0,0,.08)!important; font-weight:700!important; }
  .sidebar .nav-item[hidden] { display:none!important; }
  .sidebar-user { display:flex!important; flex:0 0 auto!important; justify-content:space-between!important; padding:12px 4px 0!important; border-top:1px solid rgba(255,255,255,.2)!important; }
  .sidebar-user #sidebar-user-name { display:block!important; }
  .fitting-checklist-table tr.fitting-checklist-entry,.product-fitting-checklist-table tr.fitting-checklist-entry { grid-template-areas:"item item" "result result" "comment comment" "task task" "owner owner" "history history"; }
  .fitting-checklist-table tr > td:nth-child(4),.product-fitting-checklist-table tr > td:nth-child(4) { grid-area:task; }
  .fitting-checklist-table tr > td:nth-child(5),.product-fitting-checklist-table tr > td:nth-child(5) { grid-area:owner; }
  .fitting-checklist-table tr > td:nth-child(6),.product-fitting-checklist-table tr > td:nth-child(6) { grid-area:history; justify-self:end; }
  .fitting-task-create-button { width:auto!important; max-width:100%; min-height:34px!important; padding:6px 11px!important; font-size:13px!important; }
  .fitting-responsibility-picker { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; }
  .fitting-responsibility-picker select,.fitting-responsibility-picker button { min-height:42px!important; font-size:14px!important; }
  .kanban-mobile-stage-control { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; gap:7px; align-items:center; position:sticky; top:0; z-index:12; width:100%; padding:7px 0; background:var(--cream); }
  .kanban-mobile-stage-control button { min-height:42px; border:1px solid var(--border); border-radius:10px; background:var(--white); color:var(--ink); font-size:20px; }
  .kanban-mobile-stage-control select { width:100%; min-width:0; min-height:42px; border:1px solid var(--border); border-radius:10px; background:var(--white); color:var(--ink); font-size:15px; }
  .kanban-board { width:100%; max-width:100%; overflow:visible!important; }
  .kanban-cols { display:block!important; width:100%!important; min-height:0!important; }
  .kanban-cols > .kanban-col { display:none!important; width:100%!important; min-width:0!important; max-width:100%!important; }
  .kanban-cols > .kanban-col.mobile-stage-active { display:block!important; }
}

/* Keep filters available in a phone sized sheet while leaving content visible. */
.mobile-filter-trigger,.mobile-filter-sheet { display:none; }
@media(min-width:761px) {
  #view-products .products-toolbar { display:flex; align-items:center; flex-wrap:nowrap; gap:8px; }
  #view-products .products-toolbar > .filter-pills { display:flex; flex-wrap:nowrap; align-items:center; gap:5px; min-width:0; margin:0 0 0 auto; overflow-x:auto; scrollbar-width:thin; }
  #view-products .products-toolbar > .filter-pills .filter-pill { flex:0 0 auto; max-width:180px; }
  #view-products .products-toolbar > .filter-pills .filter-reset { flex:0 0 auto; }
}
@media(max-width:760px) {
  .mobile-filter-trigger { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; width:100%; margin:0 0 8px; padding:9px 14px; border:1px solid var(--border); border-radius:12px; background:var(--white); color:var(--ink); font:600 14px var(--crm-font-body,system-ui,sans-serif); }
  .mobile-filter-trigger::before { content:'☷'; font-size:18px; }
  .mobile-filter-trigger .mobile-filter-count { display:inline-grid; place-items:center; min-width:21px; height:21px; padding:0 5px; border-radius:999px; background:var(--wine); color:white; font-size:12px; }
  .mobile-filter-sheet { display:flex; visibility:hidden; position:fixed; z-index:190; inset:0; align-items:flex-end; justify-content:center; background:rgba(20,17,15,.45); opacity:0; transition:opacity .18s ease,visibility .18s ease; }
  .mobile-filter-sheet.is-open { visibility:visible; opacity:1; }
  .mobile-filter-sheet-card { display:flex; flex-direction:column; width:100%; max-height:min(86dvh,760px); padding:12px 14px calc(14px + env(safe-area-inset-bottom)); border-radius:20px 20px 0 0; background:var(--cream); box-shadow:0 -8px 28px rgba(0,0,0,.2); transform:translateY(20px); transition:transform .18s ease; }
  .mobile-filter-sheet.is-open .mobile-filter-sheet-card { transform:translateY(0); }
  .mobile-filter-sheet-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:3px 0 11px; border-bottom:1px solid var(--border); }
  .mobile-filter-sheet-head strong { color:var(--wine); font-size:17px; }
  .mobile-filter-sheet-close { width:42px; min-height:42px; padding:0; border:0; border-radius:50%; background:var(--white); color:var(--ink); font-size:22px; }
  .mobile-filter-sheet-content { min-height:0; overflow:auto; padding:12px 0; overscroll-behavior:contain; }
  .mobile-filter-sheet-content .filter-pills,.mobile-filter-sheet-content .tasks-filters,.mobile-filter-sheet-content .fitting-filter-pills { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:0; }
  .mobile-filter-sheet-content .filter-pill,.mobile-filter-sheet-content .filter-pill-select { width:100%; max-width:none; min-height:48px; }
  .mobile-filter-sheet-content .filter-reset { grid-column:1/-1; min-height:44px; }
  .mobile-filter-sheet-actions { display:grid; grid-template-columns:1fr 1.4fr; gap:8px; padding-top:10px; border-top:1px solid var(--border); }
  .mobile-filter-sheet-actions button { min-height:46px; border:1px solid var(--border); border-radius:11px; background:var(--white); color:var(--ink); font:600 14px var(--crm-font-body,system-ui,sans-serif); }
  .mobile-filter-sheet-actions [data-mobile-filter-apply] { border-color:var(--wine); background:var(--wine); color:white; }
  .filter-pills[data-mobile-filter-content="true"],.tasks-filters[data-mobile-filter-content="true"],.fitting-filter-pills[data-mobile-filter-content="true"] { display:block; }
  .products-page-heading + .mobile-filter-trigger { margin-top:2px; }
  .fitting-list-controls .mobile-filter-trigger { width:100%; }

  /* Production and constructor lanes were hidden by the generic product kanban rule. */
  #view-production .prod-board .kanban-col,#view-constructors .prod-board .kanban-col { display:block!important; width:100%!important; min-width:0!important; max-width:100%!important; margin-bottom:10px; }
  #view-production .prod-board .kanban-cols,#view-constructors .prod-board .kanban-cols { display:block!important; }
  #view-production .prod-board,#view-constructors .prod-board { max-height:none!important; overflow:visible!important; }
  #view-production .kanban-toolbar,#view-constructors .kanban-toolbar { display:flex; flex-wrap:wrap; gap:7px; }
  #view-production [data-prod-size],#view-constructors [data-cl-size],#view-meeting .meeting-size-switch,.tasks-size-switch,.fitting-size-switch { display:none!important; }
  #view-constructors .cl-stage-filter { display:flex; flex-wrap:nowrap; max-width:100%; gap:6px; overflow-x:auto; padding:4px 0 8px; overscroll-behavior-x:contain; scrollbar-width:thin; }
  #view-constructors .cl-stage-filter .cl-stage-chip { flex:0 0 auto; min-height:40px; }
  #view-production .prod-search { flex:1 1 100%; width:100%; }
  #view-production .kanban-board .prod-item,#view-constructors .kanban-board .prod-item { min-height:68px; }

  /* Compact, scannable cards replace the wide checklist table on phones. */
  .fitting-checklist-table tr.fitting-checklist-entry,.product-fitting-checklist-table tr.fitting-checklist-entry { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"item item" "result result" "comment comment" "task task" "assignee assignee" "owner owner" "history history"; }
  .fitting-checklist-table tr > td:nth-child(4),.product-fitting-checklist-table tr > td:nth-child(4) { grid-area:task; }
  .fitting-checklist-table tr > td:nth-child(5),.product-fitting-checklist-table tr > td:nth-child(5) { grid-area:assignee; color:#756b58; font-size:13px; }
  .fitting-checklist-table tr > td:nth-child(6),.product-fitting-checklist-table tr > td:nth-child(6) { grid-area:owner; }
  .fitting-checklist-table tr > td:nth-child(7),.product-fitting-checklist-table tr > td:nth-child(7) { grid-area:history; justify-self:end; }
  .fitting-checklist-assignee-cell::before { content:'Ответственный за задачу'; display:block; margin-bottom:3px; color:#817866; font-size:11px; }
  .fitting-checklist-task-cell::before { content:'Задача'; display:block; margin-bottom:3px; color:#817866; font-size:11px; }
  .fitting-responsibility-picker::before { content:'Зона ответственности'; display:block; color:#817866; font-size:11px; }
  .fitting-checklist-history-cell::before { content:'История изменений'; display:block; margin-bottom:3px; color:#817866; font-size:11px; }
  .fitting-additional-table tr { grid-template-areas:"item item" "task task" "assignee assignee" "history history"!important; }
  .fitting-additional-table tr > td:nth-child(1) { grid-area:item; padding-right:37px!important; }
  .fitting-additional-table tr > td:nth-child(2) { grid-area:task; }
  .fitting-additional-table tr > td:nth-child(3) { grid-area:assignee; color:#756b58; font-size:13px; }
  .fitting-additional-table tr > td:nth-child(4) { grid-area:history; justify-self:end; }
  .fitting-additional-assignee-cell::before { content:'Ответственный за задачу'; display:block; margin-bottom:3px; color:#817866; font-size:11px; }
  .fitting-additional-table .fitting-extra-delete { position:absolute; top:7px; right:7px; }

  .settings-tiles { grid-template-columns:repeat(3,minmax(0,1fr))!important; gap:7px!important; }
  .settings-tile { min-width:0; min-height:84px; padding:9px 6px!important; gap:5px!important; }
  .settings-tile .tile-icon { font-size:19px!important; }
  .settings-tile .tile-title { font-size:12px!important; line-height:1.2; }
  .settings-tile .tile-desc { display:none; }
  .rpt-kpis { grid-template-columns:repeat(2,minmax(0,1fr))!important; gap:7px!important; }
  .rpt-kpi { min-width:0; padding:9px!important; }
  .rpt-kpi b { font-size:17px!important; }
  #view-meeting .meeting-agenda-compose { display:grid!important; grid-template-columns:1fr!important; gap:8px; }
  #view-meeting .meeting-tools-row { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
  #view-meeting #meeting-threads { min-width:0; }
  #view-meeting .meeting-thread-card { width:100%; }
}

/* Fitting item rows: keep the article summary and its four compact data toggles together. */
.fitting-product-card-row { overflow:visible; }
.fitting-product-head-row { display:grid; grid-template-columns:minmax(250px,1.2fr) minmax(180px,.8fr) auto auto; align-items:center; gap:14px; padding:14px; }
.fitting-product-head-row .fitting-product-identity { min-width:0; }
.fitting-product-block-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.fitting-card-block-toggle { display:inline-flex; align-items:center; justify-content:center; min-height:32px; padding:6px 11px; border:1px solid var(--border); border-radius:999px; background:var(--white); color:var(--ink); font:600 12px var(--crm-font-body,system-ui,sans-serif); white-space:nowrap; cursor:pointer; }
.fitting-card-block-toggle.active { border-color:var(--wine); background:var(--wine); color:#fff; }
.fitting-card-block-content { padding:0 14px 14px; }
.fitting-card-block-content[hidden] { display:none!important; }
.fitting-card-block:not(.is-open) { display:none; }
.fitting-remove-icon,.fitting-restore-icon { display:inline-grid; place-items:center; width:34px; min-width:34px; height:34px; min-height:34px; padding:0; border:1px solid #ead8d5; border-radius:50%; background:#fff8f7; color:var(--wine); font:500 20px var(--crm-font-body,system-ui,sans-serif); line-height:1; cursor:pointer; }
.fitting-restore-icon { border-color:var(--border); background:var(--white); }
.fitting-removed-meta { display:flex; align-items:center; gap:7px; color:#756b58; font-size:12px; }
.fitting-checklist-picker { display:inline-flex; align-items:center; gap:7px; max-width:100%; }
.fitting-checklist-picker-menu { position:relative; min-width:180px; max-width:min(340px,70vw); }
.fitting-checklist-picker-menu > summary { overflow:hidden; padding:7px 30px 7px 10px; border:1px solid var(--border); border-radius:9px; background:var(--white); color:var(--ink); text-overflow:ellipsis; white-space:nowrap; cursor:pointer; list-style:none; }
.fitting-checklist-picker-menu > summary::-webkit-details-marker { display:none; }
.fitting-checklist-picker-menu > summary::after { content:'⌄'; float:right; margin-right:-20px; color:var(--wine); }
.fitting-checklist-picker-options { position:absolute; z-index:70; top:calc(100% + 5px); left:0; display:grid; min-width:max(100%,250px); max-height: min(55dvh,360px); overflow:auto; padding:5px; border:1px solid var(--border); border-radius:11px; background:var(--white); box-shadow:0 10px 28px #0002; }
.fitting-checklist-picker-options button { display:grid; gap:2px; width:100%; min-height:40px; padding:8px 10px; border:0; border-radius:7px; background:transparent; color:var(--ink); text-align:left; font:inherit; cursor:pointer; }
.fitting-checklist-picker-options button.active,.fitting-checklist-picker-options button:hover { background:var(--cream); color:var(--wine); }
.fitting-checklist-picker-options small { color:#817866; font-size:10px; }
.fitting-checklist-info,.section-info { position:relative; display:inline-grid; place-items:center; width:23px; height:23px; min-height:23px; padding:0; border:1px solid #d8c8a7; border-radius:50%; background:var(--cream); color:var(--wine); font:700 12px var(--crm-font-body,system-ui,sans-serif); cursor:help; }
.fitting-checklist-info[hidden] { display:none; }
.fitting-checklist-info:hover::after,.fitting-checklist-info.is-open::after,.section-info:hover::after,.section-info.is-open::after { content:attr(title); position:absolute; z-index:85; top:calc(100% + 7px); left:50%; width:min(290px,80vw); padding:9px 11px; border:1px solid var(--border); border-radius:9px; background:var(--white); color:var(--ink); box-shadow:0 7px 22px #0002; font:400 12px/1.4 var(--crm-font-body,system-ui,sans-serif); text-align:left; transform:translateX(-50%); }
.fitting-checklist-comment-cell { position:relative; }
.fitting-checklist-comment-display,.fitting-custom-item-label { display:block; width:100%; padding:3px 20px 3px 0; border:0; background:transparent; color:var(--ink); font:inherit; line-height:1.4; text-align:left; white-space:normal; overflow-wrap:anywhere; cursor:pointer; }
.fitting-checklist-comment-delete { position:absolute; top:0; right:0; width:24px; min-height:24px; padding:0; border:0; border-radius:50%; background:#f8e8e5; color:var(--wine); font-size:17px; }
.fitting-custom-item-input { width:100%; min-height:34px; }
.fitting-add-item-row { padding:10px 0 0; text-align:center; }
.fitting-add-checklist-item { min-height:36px; padding:6px 13px; border:1px dashed #c6b893; border-radius:9px; background:transparent; color:var(--wine); font:600 13px var(--crm-font-body,system-ui,sans-serif); cursor:pointer; }
.fitting-filter-settings { position:relative; margin:8px 0; }
.fitting-filter-settings > summary,.crm-compact-settings > summary { display:inline-flex; align-items:center; min-height:38px; padding:7px 12px; border:1px solid var(--border); border-radius:10px; background:var(--white); color:var(--ink); font-weight:600; cursor:pointer; list-style:none; }
.fitting-filter-settings > summary::-webkit-details-marker,.crm-compact-settings > summary::-webkit-details-marker { display:none; }
.fitting-filter-settings-content { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:10px 0; }
.crm-compact-settings { position:relative; }
.crm-compact-settings-popover { position:absolute; z-index:55; top:calc(100% + 5px); right:0; display:grid; gap:8px; min-width:250px; max-width:min(380px,90vw); padding:13px; border:1px solid var(--border); border-radius:12px; background:var(--white); box-shadow:0 10px 28px #0002; }
.crm-compact-settings-popover .kanban-seg { flex-wrap:wrap; }
.prod-top-toolbar { align-items:center; }
.prod-top-toolbar .prod-search { flex:1 1 320px; }
.prod-top-toolbar .crm-compact-settings { flex:0 0 auto; }
.product-tabs { flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; }
.product-tab-panel { min-width:0; }
.fitting-task-history-item b { font-size:12px; }
.task-close-form [data-task-close] { grid-column:1/-1; justify-self:end; }
.task-close-form .task-result-choices { grid-column:1/-1; }
.task-close-form label { grid-column:1/-1; }

@media(max-width:760px) {
  .fitting-product-head-row { grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:10px; }
  .fitting-product-head-row .fitting-product-identity { grid-column:1/-1; }
  .fitting-product-head-row .fitting-meta { grid-column:1/-1; font-size:11px; }
  .fitting-product-block-actions { grid-column:1; flex-wrap:nowrap; max-width:calc(100vw - 90px); overflow-x:auto; padding:2px 0 4px; overscroll-behavior-x:contain; scrollbar-width:none; }
  .fitting-card-block-toggle { flex:0 0 auto; min-height:34px; padding:6px 10px; font-size:12px; }
  .fitting-card-block-content { padding:0 9px 10px; }
  .fitting-checklist-picker-menu { min-width:0; width:min(260px,70vw); }
  .fitting-checklist-picker-options { position:fixed; top:auto; left:12px; right:12px; bottom:calc(12px + env(safe-area-inset-bottom)); min-width:0; max-height:55dvh; border-radius:14px; }
  .fitting-checklist-picker-options button { min-height:48px; }
  .fitting-checklist-info { width:32px; height:32px; min-height:32px; flex:0 0 auto; cursor:pointer; }
  .fitting-checklist-info:hover::after,.section-info:hover::after { display:none; }
  .fitting-checklist-info.is-open::after,.section-info.is-open::after { position:fixed; top:auto; bottom:calc(76px + env(safe-area-inset-bottom)); left:12px; width:calc(100vw - 48px); transform:none; }
  .fitting-checklist-comment-display { min-height:32px; }
  .fitting-checklist-comment-delete { min-width:32px; min-height:32px; }
  .fitting-remove-icon,.fitting-restore-icon { width:38px; min-width:38px; height:38px; min-height:38px; }
  .fitting-detail-title-row { display:flex; flex-wrap:nowrap; align-items:center; gap:5px; }
  .fitting-detail-title-row .page-title { flex:1 1 auto; min-width:0; font-size:19px; }
  .fitting-session-edit-button,.fitting-add-product-button { min-height:36px!important; padding:6px 8px!important; font-size:11px!important; white-space:nowrap; }
  .fitting-filter-settings-content { display:grid; grid-template-columns:1fr; }
  .mobile-filter-sheet-content > .kanban-toolbar { display:grid!important; gap:12px; padding:8px 0; }
  .mobile-filter-sheet-content .crm-compact-settings { display:block; }
  .mobile-filter-sheet-content .crm-compact-settings-popover { position:static; display:grid; min-width:0; max-width:none; padding:0; border:0; box-shadow:none; }
  .mobile-filter-sheet-content .fitting-list-controls { display:flex!important; flex-wrap:wrap; }
  #view-production .prod-board .kanban-cols,#view-constructors .prod-board .kanban-cols { display:block!important; }
  #view-production .prod-board .kanban-col,#view-constructors .prod-board .kanban-col { display:none!important; width:100%!important; min-width:0!important; max-width:100%!important; margin:0; }
  #view-production .prod-board .kanban-col.mobile-stage-active,#view-constructors .prod-board .kanban-col.mobile-stage-active { display:block!important; }
  #view-production .kanban-mobile-stage-control,#view-constructors .kanban-mobile-stage-control { display:grid!important; }
  #view-production .prod-top-toolbar { display:grid!important; grid-template-columns:minmax(0,1fr) auto; gap:8px; }
  #view-production .prod-search { grid-column:1/-1; width:100%; }
  #view-production .prod-top-toolbar .crm-compact-settings-popover { right:0; }
  #view-constructors .kanban-toolbar { justify-content:flex-end; }
  #view-constructors .cl-stage-filter { display:flex; flex-wrap:nowrap; max-width:100%; overflow-x:auto; }
  .product-tabs { gap:5px; padding:4px 0 8px; }
  .product-tabs button { flex:0 0 auto; min-height:38px!important; max-height:42px; padding:6px 9px!important; font-size:12px!important; white-space:nowrap; }
  .product-tab-drag-handle { display:none!important; }
  .product-tab-panel { overflow-x:hidden; }
  .product-tab-panel .table-scroll { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
  .task-card-meta .task-created-at,.task-history-created { font-size:10px!important; }
  .tasks-lane .task-close-form { display:grid; grid-template-columns:1fr!important; }
  .tasks-lane .task-result-choices { grid-column:1!important; grid-row:auto!important; min-width:0; }
  .tasks-lane .task-result-choices > div { display:flex; flex-wrap:nowrap!important; gap:4px; }
  .tasks-lane .task-result-choices button { flex:1 1 0; min-width:0; min-height:36px; padding:4px 3px; font-size:10px; white-space:nowrap; }
  .tasks-lane .task-close-form label,.tasks-lane .task-close-form [data-task-close] { grid-column:1!important; grid-row:auto!important; width:100%; }
  #view-analytics-report .rpt-kpi { padding:7px!important; }
  #view-analytics-report .rpt-kpi b { font-size:15px!important; }
}
/* Match the task action chip to its sibling status pills exactly. */
.fitting-task-create-button { display:inline-block!important; width:auto!important; min-height:0!important; padding:3px 9px!important; border:0!important; border-radius:999px!important; background:#f5ead3!important; color:#745821!important; font:700 11px/1.35 var(--crm-font-body,system-ui,sans-serif)!important; box-shadow:none!important; }
.fitting-checklist-task-cell { text-align:center; vertical-align:middle; }
.fitting-task-create { justify-content:center; }
@media(max-width:760px) {
  #view-fittings .fitting-filter-settings > summary { display:none; }
  #view-fittings .fitting-filter-settings { margin:0; }
  #view-fittings .fitting-filter-settings-content { display:none; }
  #view-fittings .fitting-list-controls .fitting-view-group { display:flex!important; flex-wrap:wrap; }
  #view-fittings .fitting-list-controls [data-fit-sort] { display:inline-flex!important; }
  #view-fittings .fitting-list-controls [data-fit-size] { display:inline-flex!important; }
  #view-products .products-toolbar + .mobile-filter-trigger,.products-page-heading + .mobile-filter-trigger { width:auto; max-width:none; }
  .fitting-checklist-comment-cell textarea { min-height:40px; }
  .fitting-checklist-table .fitting-task-create-button { min-height:32px!important; font-size:12px!important; }
}
.nav-item[data-purchases-shortcut] { display:none!important; }
.mobile-sheet-section-title { display:block; margin:8px 0 4px; color:var(--wine); font-size:13px; }
@media(max-width:760px) {
  .sidebar .nav-item[data-purchases-shortcut] { display:flex!important; }
  .product-tab-panel > * { max-width:100%; }
  .product-tab-panel input,.product-tab-panel select,.product-tab-panel textarea { max-width:100%; box-sizing:border-box; }
  #view-products .mobile-filter-sheet-content .kanban-toolbar-label { display:block; width:100%; margin:8px 0 0; }
}

/* Follow-up fitting and mobile usability refinements. */
.fitting-product-head-row { grid-template-columns:minmax(260px,1fr) auto minmax(190px,.75fr) auto; }
.fitting-product-head-row .fitting-product-block-actions { grid-column:2; grid-row:1; }
.fitting-product-head-row .fitting-meta { grid-column:3; grid-row:1; }
.fitting-card-block-toggle { border-color:var(--wine); background:var(--wine); color:#fff; }
.fitting-card-block-toggle.active { border-color:#ad8a4f; background:#ad8a4f; color:#17130e; }
.fitting-prices { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:10px 20px; }
.fitting-checklist-picker-menu > summary { color:var(--wine); font-weight:650; }
.fitting-checklist-count { color:#756b58; font-size:12px; }
.fitting-checklist-count i { font-style:normal; }
.fitting-checklist-table .fit-col-item { width:20%; }
.fitting-checklist-table .fit-col-choice { width:7%; }
.fitting-checklist-table .fit-col-comment { width:27%; }
.fitting-checklist-table .fit-col-task { width:13%; }
.fitting-checklist-table .fit-col-assignee { width:13%; }
.fitting-checklist-table .fit-col-area { width:15%; }
.fitting-checklist-table .fit-col-history { width:5%; }
.fitting-checklist-comment-cell textarea[hidden],.fitting-custom-item-input[hidden] { display:none!important; }
.fitting-photo-groups { display:flex; flex-wrap:wrap; align-items:flex-start; gap:8px; }
.fitting-photo-group { display:grid; gap:7px; min-width:0; }
.fitting-photo-group-button { display:inline-flex; align-items:center; gap:7px; min-height:34px; padding:6px 11px; border:1px solid var(--wine); border-radius:999px; background:var(--wine); color:#fff; font:600 12px var(--crm-font-body,system-ui,sans-serif); }
.fitting-photo-group-button.active { border-color:#ad8a4f; background:#ad8a4f; color:#17130e; }
.fitting-photo-group-button small { display:inline-grid; place-items:center; min-width:18px; height:18px; border-radius:50%; background:#ffffff33; font-size:10px; }
.fitting-photo-gallery[hidden] { display:none!important; }
.fitting-size-grid-scroll { width:fit-content; max-width:100%; margin:0 auto; }
.fitting-size-table { width:auto; max-width:100%; }
.section-title-with-info { display:flex; align-items:center; gap:8px; }
.section-title-with-info .page-title { margin:0; }
.crm-compact-settings > summary { min-width:38px; width:38px; height:38px; justify-content:center; padding:8px; font-size:0; }
.crm-compact-settings > summary svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.crm-compact-settings[open] > summary { border-color:var(--wine); color:var(--wine); }
@media(max-width:760px) {
  .fitting-product-head-row { grid-template-columns:minmax(0,1fr) auto; }
  .fitting-product-head-row .fitting-product-block-actions { grid-column:1; grid-row:auto; }
  .fitting-product-head-row .fitting-meta { grid-column:1/-1; grid-row:auto; }
  .fitting-card-block-toggle { min-height:34px!important; }
  .fitting-checklist-count { flex:1 1 100%; }
  .fitting-checklist-table tr.fitting-checklist-entry { grid-template-areas:"item item" "result result" "comment comment" "task task" "assignee assignee" "owner owner" "history history"; }
  .fitting-checklist-table .fitting-checklist-assignee-cell::before { content:'Ответственный за задачу'; display:block; margin-bottom:3px; color:#817866; font-size:11px; }
  .fitting-checklist-table .fitting-responsibility-picker::before { content:'Зона ответственности'; display:block; margin-bottom:3px; color:#817866; font-size:11px; }
  .fitting-size-grid-scroll { width:100%; margin:0; }
  .fitting-photo-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .fitting-photo-group { min-width:0; }
  .fitting-photo-group-button { justify-content:center; width:100%; min-height:42px; }
  .fitting-photo-gallery:not([hidden]) { grid-column:1/-1; }
  .mobile-filter-sheet-card { max-height:min(78dvh,640px); padding:9px 12px calc(10px + env(safe-area-inset-bottom)); }
  .mobile-filter-sheet-content { display:grid; gap:5px; padding:6px 0; }
  .mobile-filter-sheet-content .filter-pills { grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px; }
  .mobile-filter-sheet-content .filter-pill,.mobile-filter-sheet-content .filter-pill-select { min-height:40px; padding:5px 8px; }
  .mobile-filter-sheet-content .filter-pill-label { font-size:10px; }
  .mobile-filter-sheet-content .filter-pill-value { font-size:13px; }
  .mobile-filter-sheet-content > .kanban-seg { display:flex!important; width:100%; }
  .mobile-filter-sheet-content > .kanban-seg button { flex:1 1 0; min-height:38px; }
  .mobile-sheet-section-title { margin:4px 0 1px; }
  .mobile-filter-sheet-actions { padding-top:6px; }
  .mobile-filter-sheet-actions button { min-height:42px; }
  /* Native app-like drawer replaces the crowded horizontal phone menu. */
  .sidebar,#app-layout > .sidebar { inset:0 auto 0 0!important; display:flex!important; flex-direction:column!important; align-items:stretch!important; gap:8px; width:min(84vw,320px)!important; height:100dvh!important; min-height:0!important; padding:calc(18px + env(safe-area-inset-top)) 14px calc(12px + env(safe-area-inset-bottom))!important; overflow-x:hidden!important; overflow-y:auto!important; white-space:normal!important; border:0!important; border-radius:0 18px 18px 0; transform:translateX(-105%); transition:transform .2s ease; background:#171513; }
  body.mobile-menu-open .sidebar { transform:translateX(0); }
  .sidebar-title { display:block!important; flex:0 0 auto; padding:0 4px 12px; color:#b1935f; font-size:18px; }
  .sidebar .nav-menu { display:flex!important; flex:1 0 auto; flex-direction:column; gap:4px; min-height:0; }
  .sidebar .nav-item,.sidebar > a.nav-item { display:flex!important; flex:0 0 auto; width:100%; max-width:none; min-width:0; min-height:46px; height:auto; justify-content:flex-start; margin:0; padding:11px 13px; border-radius:10px; font-size:15px; text-align:left; white-space:normal; }
  .sidebar .nav-item.active { background:#a98a55; color:#18140f; }
  .sidebar .nav-item[hidden] { display:none!important; }
  .sidebar-user { display:flex!important; flex:0 0 auto!important; justify-content:space-between!important; padding:12px 4px 0!important; border-top:1px solid rgba(255,255,255,.2)!important; }
  .sidebar-user #sidebar-user-name { display:block!important; }
  .mobile-nav-toggle { display:grid; position:fixed; z-index:152; top:calc(10px + env(safe-area-inset-top)); left:10px; width:44px; height:44px; min-height:44px; padding:10px; align-content:center; gap:5px; border:1px solid var(--border); border-radius:12px; background:var(--white); box-shadow:0 2px 10px #0002; }
  .mobile-nav-toggle span { display:block; height:2px; border-radius:2px; background:var(--wine); }
  .mobile-nav-backdrop { display:none; position:fixed; z-index:149; inset:0; width:100%; height:100%; border:0; background:#0006; }
  body.mobile-menu-open .mobile-nav-backdrop { display:block; }
  .mobile-nav-toggle[aria-expanded="true"] { left:min(calc(84vw - 54px),266px); }
  #app-root { padding-top:62px; }
  .suppliers-table.mobile-card-table { display:block!important; width:100%!important; min-width:0!important; }
  .suppliers-table.mobile-card-table thead { display:none!important; }
  .suppliers-table.mobile-card-table tbody { display:grid; gap:9px; }
  .suppliers-table.mobile-card-table tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px 8px; padding:10px; border:1px solid var(--border); border-radius:12px; background:var(--white); }
  .suppliers-table.mobile-card-table td { display:grid!important; grid-template-columns:minmax(0,1fr); gap:3px; min-width:0; padding:4px!important; border:0!important; text-align:left!important; overflow-wrap:anywhere; }
  .suppliers-table.mobile-card-table td::before { content:attr(data-mobile-label); color:#817866; font-size:11px; }
  .suppliers-table.mobile-card-table td:first-child,.suppliers-table.mobile-card-table td:nth-child(3) { grid-column:1/-1; }
  .suppliers-table.mobile-card-table td input,.suppliers-table.mobile-card-table td select { min-height:38px; font-size:14px; }
  .suppliers-table.mobile-card-table td.actions-cell { justify-self:end; }
}

@media(min-width:761px) { .mobile-nav-toggle,.mobile-nav-backdrop { display:none!important; } }
@media(max-width:760px) { .mobile-nav-toggle { display:grid!important; } }

/* Desktop/mobile fitting polish and settings alignment */
.kanban-mobile-stage-control { display:none; }
.constructors-heading { width:100%; margin-bottom:8px; }
.constructors-heading .crm-compact-settings { position:relative; margin-left:auto; }
.constructors-heading .crm-compact-settings-popover { right:0; left:auto; }
#view-production .section-title-with-info + .prod-top-toolbar { margin-top:13px; }
.crm-compact-settings-popover .settings-control-group { display:grid; gap:6px; width:100%; }
.crm-compact-settings-popover .settings-control-group .kanban-toolbar-label { text-align:center; }
.crm-compact-settings-popover .settings-control-group .kanban-seg { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; }
.crm-compact-settings-popover .settings-view-group .kanban-seg { grid-template-columns:repeat(4,minmax(0,1fr)); }
.crm-compact-settings-popover .settings-control-group .kanban-seg button { justify-content:center; white-space:nowrap; }
.prod-show-constructors-pill { display:inline-flex; align-items:center; justify-content:center; gap:6px; width:fit-content; justify-self:center; margin:3px auto; padding:6px 10px; border:1px solid var(--border); border-radius:999px; background:#fff; color:var(--ink); font-size:12px; }
.prod-show-constructors-pill input { margin:0; }
#view-fittings .fitting-products-toolbar { display:flex; flex-wrap:nowrap; align-items:center; gap:9px; }
#view-fittings .fitting-products-toolbar > #fit-create-session,
#view-fittings .fitting-list-filter-settings > summary { min-height:36px; height:36px; padding:0 13px; font:600 13px var(--crm-font-body,system-ui,sans-serif); white-space:nowrap; }
#view-fittings .fitting-list-filter-settings > summary { display:inline-flex; align-items:center; border:1px solid var(--wine); border-radius:10px; background:var(--wine); color:#fff; cursor:pointer; transition:transform .16s ease,box-shadow .16s ease; }
#view-fittings .fitting-list-filter-settings > summary:hover { transform:translateY(-2px); box-shadow:0 5px 14px #0002; }
#view-fittings .fitting-list-filter-settings { position:relative; flex:0 0 auto; margin:0; }
#view-fittings .fitting-list-filter-settings[open] .fitting-filter-settings-content { display:flex; }
#view-fittings .fitting-list-filter-settings .fitting-filter-settings-content { display:none; position:absolute; z-index:30; top:calc(100% + 8px); left:0; width:min(760px,90vw); padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--white); box-shadow:0 12px 36px #0002; }
#view-fittings .fitting-list-filter-settings .fitting-filter-settings-content .fitting-filter-pills { display:flex; flex-wrap:wrap; }
#view-fittings .fitting-list-search { flex:1 1 300px; min-width:200px; min-height:36px; }
#view-fittings .fitting-list-search:focus-within { outline:0; border-color:var(--border); box-shadow:none; }
#view-fittings .fitting-detail-title-row { flex-wrap:nowrap; }
#view-fittings .fitting-header-search { flex:1 1 220px; min-width:160px; }
#view-fittings .fitting-header-search:focus-within { outline:0; border-color:var(--border); box-shadow:none; }
.fitting-product-head-row { grid-template-columns:minmax(250px,1.2fr) auto minmax(190px,.8fr) auto; }
.fitting-product-head-row .fitting-product-identity { grid-column:1; }
.fitting-product-head-row .fitting-product-block-actions { grid-column:2; grid-row:1; justify-content:flex-start; gap:8px; }
.fitting-product-head-row .fitting-meta { grid-column:3; grid-row:1; }
.fitting-card-block-toggle { min-height:36px; padding:7px 13px; font-size:13px; }
.fitting-card-block-toggle.active { color:#fff!important; }
.fitting-cover:hover img { transform:scale(3); }
.fitting-checklist-picker { gap:5px; }
.fitting-checklist-label { color:#756b58; font-size:13px; font-weight:600; white-space:nowrap; }
.fitting-checklist-picker-menu { min-width:0; max-width:min(340px,70vw); }
.fitting-checklist-picker-menu > summary { display:block; padding:1px 20px 1px 0; border:0; border-radius:0; background:transparent; color:var(--wine); font-size:13px; font-weight:650; }
.fitting-checklist-picker-menu > summary::after { margin-right:-17px; }
.fitting-checklist-comment-display,.fitting-custom-item-label { font:inherit!important; font-size:11px!important; line-height:1.35; padding:3px 0; }
.fitting-checklist-comment-display { color:inherit; text-align:left; }
.fitting-checklist-assignee-cell,.fitting-responsibility-picker { font-size:11px!important; line-height:1.35; }
.fitting-checklist-task-cell { text-align:center; vertical-align:middle; }
.fitting-task-create { display:flex; align-items:center; justify-content:center; }
.fitting-photo-groups { display:flex; flex-wrap:nowrap; gap:12px; }
.fitting-photo-group { display:flex; flex-wrap:wrap; align-items:flex-start; gap:0; }
.fitting-photo-group-button { border-radius:0; }
.fitting-photo-group:first-child .fitting-photo-group-button { border-radius:999px 0 0 999px; }
.fitting-photo-group:last-child .fitting-photo-group-button { border-radius:0 999px 999px 0; }
.fitting-photo-group-button.active { color:#fff; }
.sizegrid-qc-col { width:38px!important; min-width:38px!important; max-width:38px!important; text-align:center!important; }
.sizegrid-qc-btn.sizegrid-qc-icon { display:inline-flex; align-items:center; justify-content:center; gap:3px; width:34px; min-width:34px; min-height:27px; height:27px; padding:2px; font-size:11px; }
.fitting-measurement-history { margin-top:12px; padding:8px 10px; border:1px solid var(--border); border-radius:10px; background:#fff; }
.fitting-measurement-history > summary,.fitting-measurement-history-round > summary { cursor:pointer; color:var(--wine); font-size:13px; }
.fitting-measurement-history-round { margin:8px 0; }
.fitting-measurement-history .fitting-size-table { margin-top:8px; }
.fitting-detail-preview { padding:14px 0; }
.fitting-preview-item { display:flex; align-items:center; gap:12px; min-height:68px; padding:9px 12px; border-bottom:1px solid var(--border); background:#fff; }
.fitting-preview-item img { width:48px; height:58px; border-radius:8px; object-fit:cover; }
.fitting-preview-item span { display:grid; gap:3px; }
.fitting-preview-item small { color:#827966; }
.task-fitting-source { display:grid; gap:5px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:#fbf9f3; }
.task-fitting-source a { color:var(--wine); }
@media(max-width:760px) {
  #view-fittings .fitting-products-toolbar { flex-wrap:wrap; }
  #view-fittings .fitting-products-toolbar > #fit-create-session,
  #view-fittings .fitting-list-filter-settings > summary { font-size:13px; }
  #view-fittings .fitting-list-search { flex:1 0 100%; }
  #view-fittings .fitting-list-filter-settings .fitting-filter-settings-content { position:fixed; top:calc(62px + env(safe-area-inset-top)); left:5vw; width:90vw; max-height:72dvh; overflow:auto; }
  #view-fittings .fitting-detail-title-row { flex-wrap:wrap; }
  #view-fittings .fitting-detail-title-row .page-title { flex-basis:100%; }
  #view-fittings .fitting-header-search { flex:1 1 100%; }
  .fitting-product-head-row { grid-template-columns:minmax(0,1fr) auto; }
  .fitting-product-head-row .fitting-product-identity { grid-column:1/-1; }
  .fitting-product-head-row .fitting-product-block-actions { grid-column:1/-1; grid-row:auto; order:2; flex-wrap:nowrap; max-width:100%; overflow-x:auto; }
  .fitting-product-head-row .fitting-meta { grid-column:1; grid-row:auto; order:3; }
  .fitting-product-head-row > .fitting-remove-icon,.fitting-product-head-row > .fitting-removed-meta { grid-column:2; grid-row:auto; order:4; justify-self:end; }
  .fitting-card-block-toggle { flex:0 0 auto; }
  .fitting-photo-groups { display:flex; flex-wrap:nowrap; overflow-x:auto; }
  .fitting-photo-gallery:not([hidden]) { flex-basis:100%; }
  .crm-compact-settings-popover .settings-control-group .kanban-seg { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .crm-compact-settings-popover .settings-view-group .kanban-seg { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
.fitting-photo-tabs { display:inline-flex; width:max-content; max-width:100%; border:1px solid var(--wine); border-radius:999px; overflow:hidden; }
.fitting-photo-tabs .fitting-photo-group-button { border:0; border-right:1px solid #ffffff40; border-radius:0; }
.fitting-photo-tabs .fitting-photo-group-button:last-child { border-right:0; }
.fitting-photo-tabs .fitting-photo-group-button.active { background:#ad8a4f; color:#fff; }
.fitting-photo-galleries { margin-top:9px; }
.fitting-photo-gallery[hidden] { display:none!important; }
.sizegrid-qc-col { width:38px!important; min-width:38px!important; max-width:38px!important; }

@media(max-width:760px){.fitting-checklist-comment-display,.fitting-checklist-custom-label,.fitting-checklist-assignee-cell,.fitting-responsibility-picker{font-size:14px!important;}}

.crm-compact-settings-popover { min-width:340px; }
.crm-compact-settings-popover .settings-sort-group .kanban-seg { grid-template-columns:repeat(2,minmax(0,1fr)); }
.fitting-photo-tabs .fitting-photo-group-button { width:auto; flex:0 0 auto; min-height:34px; }
@media(max-width:760px){.crm-compact-settings-popover{min-width:0;width:min(350px,88vw);}}
.fitting-task-create-button { border:0; font:700 11px var(--crm-font-body,system-ui,sans-serif); line-height:normal; cursor:pointer; }
@media(max-width:760px){.fitting-photo-tabs{width:100%;max-width:100%;justify-content:flex-start;overflow-x:auto;scrollbar-width:thin;}.fitting-photo-tabs .fitting-photo-group-button{flex:0 0 auto;}}

/* Final polish for the screens reviewed in the CRM walkthrough. */
@media (min-width:761px) { .kanban-mobile-stage-control { display:none!important; } }
@media (max-width:760px) { .kanban-mobile-stage-control { display:grid!important; } }
.kanban-size-medium .kanban-thumb-box { background:transparent; }
.kanban-size-medium .kanban-thumb-box img { width:100%; height:100%; object-fit:cover; background:transparent; }
:where(.search-pill,.prod-search,.fitting-list-search,.fitting-header-search):focus-within { outline:0!important; box-shadow:none!important; }
:where(.search-pill,.prod-search,.fitting-list-search,.fitting-header-search) input:focus-visible { outline:0!important; box-shadow:none!important; }
.crm-compact-settings-popover { min-width:360px; }
.crm-compact-settings-popover .settings-sort-group .kanban-seg button,.crm-compact-settings-popover .settings-view-group .kanban-seg button { width:100%; min-width:0; padding-inline:7px; font-size:12px; }
.crm-compact-settings-popover .kanban-seg { display:grid; width:100%; grid-auto-columns:minmax(0,1fr); }
#view-constructors .crm-compact-settings-popover .settings-sort-group .kanban-seg { grid-template-columns:repeat(2,minmax(0,1fr)); }
#view-constructors .crm-compact-settings-popover .settings-view-group .kanban-seg { grid-template-columns:repeat(4,minmax(0,1fr)); }
#view-production .section-title-with-info { margin-bottom:14px; }
#view-production .prod-top-toolbar { margin-top:14px!important; }
#view-fittings .fitting-list-filter-settings > summary { width:38px; height:36px; justify-content:center; padding:0!important; border:1px solid var(--gold)!important; background:var(--gold)!important; color:#fff!important; }
#view-fittings .fitting-list-filter-settings > summary::-webkit-details-marker { display:none; }
#view-fittings .fitting-list-filter-settings > summary svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; }
#view-fittings .fitting-list-filter-settings .fitting-filter-settings-content { width:min(480px,90vw); left:50%; transform:translateX(-50%); }
#view-fittings .fitting-list-filter-settings[open] .fitting-filter-settings-content { position:fixed; z-index:120; top:50%; left:50%; transform:translate(-50%,-50%); box-sizing:border-box; width:min(480px,calc(100vw - 24px)); max-width:calc(100vw - 24px); max-height:min(78dvh,620px); overflow:auto; }
#view-fittings .fitting-list-filter-settings .fitting-filter-settings-content .fitting-list-controls { display:grid; gap:14px; justify-items:center; }
#view-fittings .fitting-list-filter-settings .fitting-sort-controls,#view-fittings .fitting-list-filter-settings .fitting-view-group { display:grid; justify-items:center; gap:6px; width:100%; }
#view-fittings .fitting-list-filter-settings .kanban-seg { justify-content:center; flex-wrap:wrap; }
#view-fittings .fitting-product-head-row { grid-template-columns:minmax(240px,1fr) auto minmax(190px,.8fr) 28px; gap:10px; }
#view-fittings .fitting-product-head-row > .fitting-remove-icon { grid-column:4; grid-row:1; justify-self:end; align-self:center; }
.fitting-remove-icon { width:28px!important; min-width:28px!important; height:32px!important; min-height:32px!important; border:0!important; border-radius:0!important; background:transparent!important; color:var(--wine)!important; font-size:23px!important; }
.fitting-photo-tabs { gap:3px; padding:3px; border:0; background:#f4f0e7; }
.fitting-photo-tabs .fitting-photo-group-button,.fitting-photo-tabs .fitting-photo-group-button:first-child,.fitting-photo-tabs .fitting-photo-group-button:last-child { border:0; border-radius:999px; background:transparent; color:var(--wine); }
.fitting-photo-tabs .fitting-photo-group-button.active { background:var(--wine); color:#fff; }
.fitting-size-grid-scroll { width:max-content; max-width:100%; margin:0!important; }
.fitting-size-table { table-layout:fixed; }
.fitting-size-table th,.fitting-size-table td { overflow-wrap:anywhere; }
.fitting-size-table .sizegrid-qc-col { width:42px!important; min-width:42px!important; max-width:42px!important; }
.sizegrid-qc-btn.sizegrid-qc-icon { width:36px; min-width:36px; }
.meeting-agenda-article { cursor:pointer!important; text-decoration:none; }
.meeting-agenda-article:hover { color:var(--wine); text-decoration:underline; }
.meeting-agenda-actions { position:relative; }
.meeting-agenda-task-popover { position:fixed; z-index:10000; top:12px; left:12px; width:min(360px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); overflow:auto; box-sizing:border-box; padding:12px; border:1px solid var(--border); border-radius:12px; background:var(--white); box-shadow:0 12px 32px #0002; font-size:12px; }
.meeting-agenda-task-popover > b { display:block; margin-bottom:7px; color:var(--wine); }
.meeting-agenda-task-popover dl { display:grid; grid-template-columns:110px minmax(0,1fr); gap:4px 8px; margin:0; }
.meeting-agenda-task-popover dt { color:var(--muted); }
.meeting-agenda-task-popover dd { min-width:0; margin:0; overflow-wrap:anywhere; }
.task-card-summary { grid-template-columns:minmax(0,1fr) auto; }
.task-summary-origin { grid-column:1/-1; display:flex; align-items:center; flex-wrap:wrap; gap:6px 9px; min-width:0; font-size:12px; }
.task-origin-pill { padding:3px 8px; border-radius:999px; background:#f2eddf; color:#6e5b39; font-size:11px; }
.task-summary-product { display:inline-flex; align-items:center; min-height:28px; padding:3px 8px; border-radius:999px; background:#f8f4eb; color:var(--wine); font-size:12px; text-decoration:none; }
.task-fitting-source,.task-fitting-source * { font-size:inherit; line-height:1.4; }
.task-fitting-source { font-size:13px; }
.task-fitting-source b { font-size:inherit; }
#view-tasks .task-fitting-source,#view-tasks .task-fitting-source * { font-size:12px!important; line-height:1.35!important; }
#view-tasks .task-fitting-source { gap:3px; padding:7px 9px; }
#view-tasks .task-rework-note,#view-tasks .task-rework-note * { font-size:12px!important; line-height:1.35!important; }
#view-tasks .task-rework-note { padding:6px 8px; }
#view-meeting .meeting-agenda-actions > .meeting-note-delete { position:static; inset:auto; flex:0 0 auto; width:auto; height:auto; min-width:0; min-height:0; padding:2px 5px; border:0; border-radius:0; background:transparent; color:#80796e; font-size:17px; line-height:1; }

@media(min-width:761px) {
  #view-fittings .fitting-list-filter-settings[open] .fitting-filter-settings-content { top:50%; bottom:auto; }
}
#view-meeting .meeting-agenda-row-discussable .meeting-agenda-topic-text { cursor:pointer; }

@media(max-width:760px) {
  #view-fittings .fitting-list-filter-settings .fitting-filter-settings-content { position:fixed; top:auto; bottom:calc(8px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); width:min(90vw,520px); max-width:calc(100vw - 20px); max-height:76dvh; overflow:auto; }
  #view-fittings .fitting-detail-title-row { gap:7px; }
  #view-fittings .fitting-detail-title-row .page-title { flex-basis:100%; margin-bottom:2px; }
  #view-fittings .fitting-detail-title-row .fitting-session-edit-button,#view-fittings .fitting-detail-title-row .fitting-add-product-button { flex:0 0 auto; min-height:36px; padding:6px 9px; font-size:12px; }
  #view-fittings .fitting-detail-title-row .fitting-header-search { flex:1 1 100%; min-width:0; }
  #view-fittings .fitting-product-head-row { grid-template-columns:minmax(0,1fr) 28px; gap:7px; }
  #view-fittings .fitting-product-head-row .fitting-product-block-actions { grid-column:1/-1; order:2; justify-content:flex-start; }
  #view-fittings .fitting-product-head-row .fitting-meta { grid-column:1; order:3; font-size:11px; }
  #view-fittings .fitting-product-head-row > .fitting-remove-icon { grid-column:2; order:4; align-self:center; }
  .fitting-checklist-table tr.fitting-checklist-entry,.product-fitting-checklist-table tr.fitting-checklist-entry { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"item item" "result result" "comment comment" "task task" "assignee assignee" "area history"; gap:5px 8px; }
  .fitting-checklist-table tr.fitting-checklist-entry > td,.product-fitting-checklist-table tr.fitting-checklist-entry > td { min-width:0; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(1),.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(1) { grid-area:item; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(2),.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(2) { grid-area:result; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(3),.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(3) { grid-area:comment; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(4),.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(4) { grid-area:task; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(5),.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(5) { grid-area:assignee; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(6),.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(6) { grid-area:area; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(7),.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(7) { grid-area:history; justify-self:end; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(n+2)::before,.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(n+2)::before { display:block; margin:0 0 2px; color:#817866; font-size:10px; font-weight:500; line-height:1.25; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(2)::before,.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(2)::before { content:'Решение'; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(3)::before,.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(3)::before { content:'Комментарий / что поправить'; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(4)::before,.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(4)::before { content:'Задача'; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(5)::before,.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(5)::before { content:'Ответственный за задачу'; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(6)::before,.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(6)::before { content:'Зона ответственности'; }
  .fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(7)::before,.product-fitting-checklist-table tr.fitting-checklist-entry > td:nth-child(7)::before { content:'История изменений'; }
  .fitting-checklist-table .fitting-checklist-task-cell,.product-fitting-checklist-table .fitting-checklist-task-cell { text-align:left; }
  .fitting-grid-toolbar { display:flex; flex-wrap:wrap; gap:6px; }
  .fitting-size-grid-scroll { width:100%; overflow:visible!important; margin:0!important; }
  .sizegrid-qc-col { width:auto!important; min-width:0!important; max-width:none!important; }
  .fitting-size-table .sizegrid-qc-col { grid-column:1/-1; }
  .sizegrid-qc-btn.sizegrid-qc-icon { width:auto; min-width:40px; min-height:38px; }
  .fitting-measurement-history { position:relative; }
  .fitting-measurement-history[open] { max-height:62vh; overflow:auto; }
  #view-meeting .meeting-agenda-compose { display:grid!important; grid-template-columns:auto minmax(0,1fr) auto!important; gap:6px; padding:8px; }
  #view-meeting .meeting-agenda-compose [data-meeting-agenda-date] { grid-column:1; width:108px; min-height:38px; font-size:12px; }
  #view-meeting .meeting-agenda-compose [data-meeting-agenda-topic] { grid-column:2/-1; min-height:40px; }
  #view-meeting .meeting-agenda-compose [data-meeting-add-article] { grid-column:1; min-height:36px; padding:5px 8px; font-size:12px; }
  #view-meeting .meeting-agenda-compose [data-meeting-agenda-add] { grid-column:3; min-height:36px; padding:5px 9px; font-size:12px; }
  #view-meeting .meeting-agenda-compose .meeting-agenda-product-picker { grid-column:2/-1; }
  #view-meeting .meeting-agenda-row { grid-template-columns:auto minmax(0,1fr); align-items:start; }
  #view-meeting .meeting-agenda-date { display:inline-flex; min-height:30px; align-items:center; font-size:11px; }
  #view-meeting .meeting-agenda-topic { grid-column:2; min-width:0; white-space:normal; overflow-wrap:anywhere; }
  #view-meeting .meeting-agenda-meta { display:block; grid-column:2; font-size:11px; }
  #view-meeting .meeting-agenda-actions { grid-column:1/-1; flex-wrap:wrap; }
  #view-meeting .meeting-agenda-task-popover { position:fixed; z-index:220; top:auto; right:5vw; bottom:calc(8px + env(safe-area-inset-bottom)); width:90vw; max-height:65dvh; }
  .task-summary-origin { align-items:flex-start; }
  .task-summary-product { min-height:34px; }
  .tasks-tabs { justify-content:flex-start!important; margin-right:auto; }
  #view-products .products-page-heading { gap:8px; }
  #view-products #new-product-btn { flex:0 0 auto; min-height:38px; margin:0 0 0 6px; padding:7px 10px; font-size:12px; }
  #view-products .products-toolbar .search-pill { flex:1 1 100%; }
  #view-constructors .constructors-heading .crm-compact-settings-popover { left:auto; right:0; }
  .crm-preview-toolbar { flex-wrap:wrap; }
  .crm-compact-settings-popover { min-width:0; width:min(370px,90vw); }
}
@media(max-width:760px) {
  .nav-item[data-purchases-shortcut] { display:none!important; }
  #view-fittings .fitting-filter-settings > summary { display:inline-flex!important; }
  #view-fittings .fitting-filter-settings[open] .fitting-filter-settings-content { display:grid!important; }
}
#view-fittings .fitting-card-block-toggle { border:1px solid var(--border); background:#fff; color:var(--wine); }
#view-fittings .fitting-card-block-toggle.active { border-color:var(--wine)!important; background:var(--wine)!important; color:#fff!important; }
.fitting-measurement-history { width:max-content; max-width:100%; margin:10px 0 8px auto!important; }
.fitting-measurement-history > summary { min-height:34px; padding:7px 10px; border:1px solid var(--border); border-radius:999px; background:#fff; }
.fitting-measurement-history[open] .fitting-measurement-history-round .table-scroll { max-width:min(75vw,800px); overflow:auto; }
.fitting-responsibility-picker:has(.fitting-responsibility-stage) { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; min-width:150px; }
.fitting-responsibility-stage { width:100%; min-width:0; min-height:32px; padding:5px 7px; border:1px solid var(--border); border-radius:7px; background:var(--white); color:var(--ink); font:inherit; font-size:11px; }
.fitting-responsibility-search-slot { display:block; min-width:0; }
.fitting-responsibility-search-slot .fitting-responsibility-search { grid-column:auto; }
.fitting-responsibility-cancel { justify-self:start; padding:3px 7px; border:0; background:transparent; color:#817866; font:inherit; font-size:11px; cursor:pointer; }

/* Fitting tables and history stay compact beside the current size grid. */
#view-fittings .fitting-measurements-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:18px; padding:0 10px; }
#view-fittings .fitting-measurements-current { min-width:0; }
#view-fittings .fitting-size-grid-scroll { margin:0 0 10px!important; }
#view-fittings .fitting-size-table th.sizegrid-qc-col,#view-fittings .fitting-size-table td.sizegrid-qc-col { width:66px!important; min-width:66px!important; max-width:66px!important; white-space:nowrap!important; text-align:center!important; }
#view-fittings .sizegrid-qc-btn.sizegrid-qc-icon { width:38px!important; min-width:38px!important; height:32px!important; min-height:32px!important; padding:4px!important; }
#view-fittings .sizegrid-qc-btn.sizegrid-qc-icon svg { display:block; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
#view-fittings .fitting-measurement-history { min-width:0; margin:4px 0 0!important; padding:0!important; border:0!important; background:transparent!important; }
#view-fittings .fitting-measurement-history-toggle { display:block; margin:0 auto 8px; padding:6px 10px; border:0; background:transparent; color:var(--wine); font:600 13px var(--crm-font-body,system-ui,sans-serif); text-align:center; cursor:pointer; }
#view-fittings .fitting-measurement-history-content { padding:9px; border:1px solid var(--border); border-radius:10px; background:#fff; }
#view-fittings .fitting-measurement-history-list { display:grid; gap:5px; max-height:150px; overflow:auto; margin-bottom:8px; }
#view-fittings .fitting-measurement-history-list button { padding:6px 8px; border:1px solid var(--border); border-radius:7px; background:#fff; color:var(--ink); font:inherit; font-size:11px; text-align:left; cursor:pointer; }
#view-fittings .fitting-measurement-history-list button.active { border-color:var(--wine); background:#fbf3f1; color:var(--wine); }
#view-fittings .fitting-measurement-history-table { max-width:100%; overflow:auto; }
#view-fittings .fitting-measurement-history-table .fitting-size-table { min-width:max-content; }
.fitting-custom-item-delete { margin-left:7px; width:19px; height:19px; padding:0; border:0; border-radius:50%; background:transparent; color:var(--muted); font:500 14px/19px var(--crm-font-body,system-ui,sans-serif); cursor:pointer; opacity:.55; }
.fitting-custom-item-delete:hover { background:#f8e8e6; color:var(--wine); opacity:1; }
#view-fittings .fitting-photo-library { margin:14px 10px!important; padding:12px 14px!important; }
.fitting-detail-preview .fitting-preview-item { display:grid; grid-template-columns:48px minmax(0,1fr) auto; gap:10px; }
.fitting-detail-preview .fitting-preview-tabs { display:flex; flex-wrap:wrap; gap:5px; }
.fitting-detail-preview .fitting-preview-tabs span { padding:5px 8px; border:1px solid var(--border); border-radius:999px; background:#fff; color:var(--wine); font-size:11px; }
@media(max-width:900px) { #view-fittings .fitting-measurements-layout { grid-template-columns:minmax(0,1fr); gap:8px; padding:0 8px; } }
@media(max-width:760px) { #view-fittings .fitting-measurements-layout { padding:0 4px; } #view-fittings .fitting-photo-library { margin:12px 4px!important; } }

/* Keep the fittings settings panel attached to its trigger and within the viewport. */
#view-fittings .fitting-list-filter-settings[open] .fitting-filter-settings-content { position:fixed; z-index:120; top:12px; left:12px; bottom:auto; transform:none; box-sizing:border-box; width:min(480px,calc(100vw - 24px)); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); overflow:auto; }
@media(max-width:760px) { #view-fittings .fitting-list-filter-settings[open] .fitting-filter-settings-content { width:min(90vw,520px); max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px - env(safe-area-inset-top)); } }
