* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
  background: #e8e8e8;
}

/* ── Viewport (3D canvas) ── */
#viewport {
  position: absolute;
  top: 0; left: 0;
  right: 450px; /* sidebar 70 + panel 380 — панель расширена под крупнее шрифты, см. задание «интерфейс 19,07» */
  bottom: 0;
}

/* ── Кнопка «Назад» (отмена последних изменений, см. js/core/history.js) — плавающая поверх
   3D-вида, всегда доступна независимо от активной вкладки. Задизейблена, когда откатываться
   некуда (только текущее состояние в истории). ── */
#undoBtn {
  position: absolute;
  top: 16px; left: 16px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid #d0d7e3;
  background: rgba(255,255,255,0.92);
  color: #445;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 6;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
#undoBtn svg {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#undoBtn:hover:not(:disabled) { background: #eef2fb; color: #2f6fed; border-color: #2f6fed; }
#undoBtn:disabled { opacity: 0.35; cursor: default; }

/* ── Оверлей размерных линий поверх 3D-вида (js/core/dimensions.js) — HTML-слой, не 3D-геометрия,
   поэтому всегда поверх содержимого канваса независимо от перекрытий. pointer-events:none на
   контейнере и на статичных подписях (не мешают вращению камеры мышкой), редактируемые поля во
   время драга элемента — pointer-events:auto (единственное исключение). ── */
#dimOverlay {
  position: absolute;
  top: 0; left: 0;
  right: 450px; /* совпадает с #viewport */
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

#dimArrowsSvg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}

/* Тонкая стрелка от одной границы измеряемого просвета до другой — чтобы было видно, ЧТО именно
   меряет число рядом (не только его значение), см. js/core/dimensions.js. */
.dim-arrow-line {
  stroke: #8a92a6;
  stroke-width: 1.2;
}
.dim-arrow-head {
  fill: #8a92a6;
}

/* Подсветка секции, выбранной кликом по карточке в боковой панели (js/core/tabs.js, dimensions.js)
   — полупрозрачный прямоугольник по передней грани секции, поверх канваса, но не мешает вращению
   камеры (pointer-events:none). transition — плавно едет за камерой при вращении/зуме. */
#sectionHighlight {
  position: absolute;
  z-index: 0;
  background: rgba(47, 111, 237, 0.10);
  border: 1.5px solid rgba(47, 111, 237, 0.55);
  border-radius: 3px;
  pointer-events: none;
  transition: left 0.08s linear, top 0.08s linear, width 0.08s linear, height 0.08s linear;
}

.dim-label {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,0.88);
  border: 1px solid #c8d0e0;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-weight: 600;
  color: #445;
  white-space: nowrap;
  pointer-events: none;
}

/* Галочка фиксации просвета (см. sec.lockedGaps, js/core/dimensions.js) — единственная
   интерактивная часть подписи, родитель .dim-label сам pointer-events:none (не должен мешать
   вращению камеры мышкой). */
.dim-lock-cb {
  pointer-events: auto;
  width: 11px;
  height: 11px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.dim-drag-input {
  position: absolute;
  z-index: 2; /* поверх .dim-label — при драге поле того же просвета не должно перекрываться статичной подписью */
  transform: translate(-50%, -50%);
  width: 56px;
  text-align: center;
  border: 1.5px solid #2f6fed;
  border-radius: 4px;
  padding: 2px 3px;
  font-size: 12px;
  font-weight: 700;
  color: #222;
  background: #fff;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dim-drag-input:focus { outline: none; border-color: #e6a800; background: #fffbea; }

/* Стрелка «сдвинуть вплотную к соседу» рядом с полем просвета (js/core/itemDrag.js, задание
   «смещение элемента до края 19,07») — тот же принцип позиционирования/z-index, что и у самого
   поля, просто сдвинута правее (см. positionSnapBtn). */
.dim-snap-btn {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.5px solid #2f6fed;
  border-radius: 4px;
  background: #fff;
  color: #2f6fed;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.dim-snap-btn:hover { background: #eef3ff; }

/* ── Инфопанель выбранного элемента (js/core/itemDrag.js) — пока элемент "выбран" (зажата ЛКМ
   или после отпускания, пока не кликнули мимо), в углу вьюпорта, не мешает перетаскиванию ── */
.drag-info-panel {
  display: none;
  position: absolute;
  /* правее кнопки «Назад», НИЖЕ индикатора процесса (#processIndicator сверху) — не перекрываются */
  top: 60px; left: 68px;
  max-width: 240px;
  background: rgba(255,255,255,0.94);
  border: 1px solid #d0d7e3;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #333;
  line-height: 1.5;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  pointer-events: none;
  z-index: 5;
}
.drag-info-panel.visible { display: block; pointer-events: auto; }
.drag-info-panel-title { font-weight: 700; color: #222; margin-bottom: 3px; font-size: 13px; }

/* ── Sidebar (иконки вкладок) ── */
#sidebar {
  position: absolute;
  top: 0; right: 380px;
  width: 70px; height: 100%;
  background: #f0f0f0;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0;
  gap: 4px;
  z-index: 10;
  /* Кнопок много, мониторы разные — если не влезают по высоте, полоса прокручивается
     (задание 30,07). Тонкий скроллбар, чтобы не съедать ширину. */
  overflow-y: auto;
  overflow-x: hidden;
}
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
/* В прокручиваемой колонке кнопки не должны сжиматься (иначе «схлопнутся» вместо скролла). */
.tab-btn, .account-chip { flex-shrink: 0; }

/* ── Индикатор процесса (задание 30,07, п.3): где ты сейчас — новая прорисовка / открыт
   заказ-проект / правка позиции. Синяя точка = новая, зелёная = правка открытого. ── */
#processIndicator {
  position: absolute;
  top: 16px; left: 68px;
  display: flex; align-items: center; gap: 7px;
  max-width: 260px;
  background: rgba(255,255,255,0.94);
  border: 1px solid #d0d7e3;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px; font-weight: 600; color: #445;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
}
#processIndicator .pi-dot { width: 8px; height: 8px; border-radius: 50%; background: #2f6fed; flex-shrink: 0; }
#processIndicator .pi-text { overflow: hidden; text-overflow: ellipsis; }
/* new = новая прорисовка (синий, по умолчанию), saved = открытый проект/заказ без правок (зелёный),
   modified = открытый, но изменён после сохранения (оранжевый). */
#processIndicator.saved { border-color: #1d9a4a; color: #1d9a4a; }
#processIndicator.saved .pi-dot { background: #1d9a4a; }
#processIndicator.modified { border-color: #e6a800; color: #a07000; }
#processIndicator.modified .pi-dot { background: #e6a800; }

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 58px;
  padding: 10px 4px 8px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: #777;
  gap: 5px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tab-btn svg {
  width: 26px; height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab-btn span {
  font-size: 8px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.tab-btn:hover {
  background: #e4e4e4;
  color: #444;
}

.tab-btn.active {
  background: #fff;
  color: #2f6fed;
  border-color: #2f6fed;
}

.tab-btn-admin { color: #a07000; }
.tab-btn-admin.active { color: #a07000; border-color: #a07000; }

/* Аккаунт-чип — прижат к низу (margin-top:auto тянет вниз и его, и «Выход» под ним). */
.account-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 58px; padding: 8px 4px; margin-top: auto;
  border-radius: 10px; color: #2f6fed; background: #eaf1ff;
  gap: 3px; cursor: default;
}
.account-chip svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.account-chip span {
  font-size: 8px; font-weight: 600; text-align: center; line-height: 1.15;
  max-width: 54px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Кнопка «Выход» — сразу под аккаунт-чипом внизу, красноватая (задание «выйти 29,07») */
.tab-btn-logout { color: #c0392b; }
.tab-btn-logout:hover { background: #fbeaea; color: #c0392b; }

/* ── Panel (контент вкладки) ── */
#panel {
  position: absolute;
  top: 0; right: 0;
  width: 380px; height: 100%;
  background: #fff;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Полоса типа изделия ── */
#typeBar {
  position: relative; /* якорь для .kit-new-btn */
  flex-shrink: 0;
  padding: 7px 16px;
  background: #eef3ff;
  border-bottom: 1px solid #d0dcf8;
  font-size: 12px;
  font-weight: 700;
  color: #2f6fed;
  letter-spacing: 0.2px;
  display: none;
}

/* Кнопки в полосе комплекта: «Сохранить» (перезаписать открытый проект/заказ) и «+ Новая» */
.kit-actions {
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  display: flex;
  gap: 6px;
  align-items: center;
}

/* «+ Новая» — начать новую прорисовку (order.js startNewKit с предложением сохранить) */
.kit-new-btn {
  padding: 4px 10px;
  border: 1.5px solid #2f6fed;
  border-radius: 6px;
  background: #fff;
  color: #2f6fed;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.kit-new-btn:hover { background: #eef3ff; }

/* «Сохранить» — перезаписать открытый проект/заказ (order.js saveOpenProject). Заливкой, а не
   контуром: это основное действие полосы, «+ Новая» рядом — второстепенное. */
.kit-save-btn {
  padding: 4px 10px;
  border: 1.5px solid #2f6fed;
  border-radius: 6px;
  background: #2f6fed;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.kit-save-btn:hover { background: #1f5ad6; border-color: #1f5ad6; }
/* Есть несохранённые правки — кнопка заметнее (оранжевая, как статус «изменён») */
.kit-save-btn.kit-save-dirty { background: #e08a2b; border-color: #e08a2b; }
.kit-save-btn.kit-save-dirty:hover { background: #c9761d; border-color: #c9761d; }

/* Типы «в разработке» — заблокированы, приглушены, с подписью */
.type-btn:disabled { cursor: default; opacity: 0.45; }
.type-btn:disabled:hover { border-color: #e0e0e0; color: inherit; }
.wip-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  color: #b06a00;
  margin-top: 2px;
}
/* Пометка «в разработке» в заголовке группы/подписи чекбокса — в строку, не блоком */
.field-group-title .wip-label,
.checkbox-field .wip-label { display: inline; margin-left: 6px; }
/* Заблокированные контролы «в разработке» на «Фасаде» (профиль) */
.profile-btn:disabled { cursor: default; opacity: 0.45; }

/* Шапка контекста: сверху «Правка позиции #N» (крупнее), ниже комплект, ниже тип изделия */
#editBar {
  font-size: 13px;
  font-weight: 700;
  color: #d97706;
}
#kitBar {
  font-size: 12px;
  font-weight: 600;
  color: #6b87c7;
  /* место под кнопки справа (.kit-actions) — длинное имя заказа обрезаем многоточием,
     иначе оно уезжало бы под «Сохранить»/«+ Новая» */
  padding-right: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#kitBar.kit-editing { color: #1d9a4a; }
#typeBarName { font-size: 11px; font-weight: 600; margin-top: 1px; }

.tab-pane {
  display: none;
  flex: 1;
  min-height: 0; /* без этого flex-элемент растёт по контенту вместо сжатия под overflow-y:auto —
                    длинные списки (например, секции верхней части) обрезались бы #panel'ом
                    (overflow:hidden) без возможности прокрутки до них мышкой */
  overflow-y: auto;
  padding: 16px 16px 0;
}

.tab-pane.active { display: flex; flex-direction: column; }

.pane-title {
  font-size: 17px;
  font-weight: 700;
  color: #222;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  flex-shrink: 0;
}

/* ── Тип изделия — сетка кнопок ── */
.type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: #555;
  transition: all 0.15s;
}

.type-btn svg {
  width: 36px; height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.type-btn:hover { background: #f0f4ff; color: #2f6fed; border-color: #a8c0f8; }
.type-btn.active { background: #eef3ff; color: #2f6fed; border-color: #2f6fed; }

/* ── Группы полей ── */
.field-group {
  margin-bottom: 16px;
}

.field-group-title {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #555;
  margin-bottom: 5px;
}

.field-val {
  font-weight: 600;
  color: #222;
}

.dim-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.dim-label-row label { margin: 0; }
.dim-input {
  width: 72px;
  padding: 3px 6px;
  border: 1.5px solid #d0d7e3;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #222;
  text-align: right;
  background: #f7f9fc;
}
.dim-input:focus { outline: none; border-color: #2f6fed; background: #fff; }

.field input[type="range"] { width: 100%; }

.field select {
  width: 100%;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
  color: #333;
  padding: 0 8px;
}

.checkbox-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  justify-content: flex-start;
}

.checkbox-field input { width: 16px; height: 16px; }

/* ── Пресеты ── */
.presets { display: flex; flex-wrap: wrap; gap: 6px; }

.preset-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #f8f8f8;
  font-size: 11px;
  color: #333;
  cursor: pointer;
}

.preset-btn:hover { background: #eef3ff; border-color: #2f6fed; color: #2f6fed; }

/* ── Фасад — типы ── */
.fasad-type-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fasad-type-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  text-align: left;
  transition: all 0.15s;
}

.fasad-type-btn svg {
  width: 36px; height: 44px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.fasad-type-btn:hover { background: #f0f4ff; color: #2f6fed; border-color: #a8c0f8; }
.fasad-type-btn.active { background: #eef3ff; color: #2f6fed; border-color: #2f6fed; }

/* ── Материалы ── */
.mat-section {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.mat-section:last-child { border-bottom: none; }

.mat-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

/* ── Цветовые образцы ── */
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.swatch {
  width: 40px; height: 40px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
  position: relative;
  transition: transform 0.1s, border-color 0.1s;
}

.swatch:hover { transform: scale(1.08); }
.swatch.selected { border-color: #2f6fed; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12), 0 0 0 3px rgba(47,111,237,0.18); }

.swatch-name {
  margin-top: 6px;
  font-size: 11px;
  color: #2f6fed;
  font-weight: 600;
  min-height: 14px;
}

/* ── Сворачиваемые доп. опции ── */
.extra-details {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.extra-details summary {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.extra-details summary::before {
  content: '▸';
  font-size: 10px;
  transition: transform 0.15s;
  display: inline-block;
}

.extra-details[open] summary::before { transform: rotate(90deg); }
.extra-details summary:hover { color: #555; background: #f8f8f8; }

.extra-details .field-group { padding: 0 14px; }
.extra-details .field-group:last-child { padding-bottom: 12px; }

/* ── Цена (всегда внизу) ── */
#price-footer {
  flex-shrink: 0;
  padding: 12px 16px;
  background: #f8f9fb;
  border-top: 1px solid #e8e8e8;
}

.price-rows { margin-bottom: 10px; }

.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #555;
  padding: 3px 0;
}

.price-row.total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
  font-weight: 700;
  font-size: 15px;
  color: #111;
}

/* ── Бейдж на иконке Заказ ── */
.tab-btn-order { position: relative; }
.order-badge {
  position: absolute;
  top: 6px; right: 6px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e84040;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ── Карточки во вкладке Заказ ── */
.order-card {
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fafafa;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.order-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.order-card-num {
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
}

.order-card-name {
  overflow-wrap: break-word;
  font-size: 13px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
}

.order-card-remove {
  background: none;
  border: none;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.order-card-remove:hover { color: #e44; }

.order-card-price {
  font-size: 15px;
  font-weight: 700;
  color: #2f6fed;
  margin-bottom: 8px;
}

.order-card-edit {
  width: 100%;
  padding: 7px;
  border: 1px solid #2f6fed;
  border-radius: 6px;
  background: transparent;
  color: #2f6fed;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.order-card-edit:hover { background: #eef3ff; }
.order-card-edit.editing {
  background: #fff3cd;
  border-color: #e6a800;
  color: #a07000;
}

.order-grand-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  color: #111;
  padding: 12px 0 0;
  border-top: 2px solid #e0e0e0;
  margin-top: 4px;
}

/* ── Вкладка «Добавить к заказу» ── */
.extra-price-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  padding: 10px 0 0;
  border-top: 1.5px solid #e0e0e0;
  margin-top: 10px;
}
.extra-result {
  margin-top: 10px;
  font-size: 12px;
  color: #1d9a4a;
  min-height: 16px;
}

/* ── Футер: текущая позиция + счётчик ── */
.price-row.current-total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #e0e0e0;
  font-weight: 600;
  color: #333;
}

.order-counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding: 6px 10px;
  background: #eef3ff;
  border-radius: 6px;
  font-size: 12px;
  color: #555;
}

.order-counter-link {
  background: none;
  border: none;
  color: #2f6fed;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.add-item-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 2px dashed #2f6fed;
  border-radius: 8px;
  background: transparent;
  color: #2f6fed;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.add-item-btn:hover { background: #eef3ff; }

/* «Обновить прорисовку» — зелёная сплошная (перезапись существующей позиции, не добавление). */
.update-item-btn { border-style: solid; border-color: #1d9a4a; color: #1d9a4a; margin-top: 6px; }
.update-item-btn:hover { background: #eafaf0; }

.order-btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: #2f6fed;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.order-btn:hover { background: #2559c7; }

/* «Добавить в заказ» — клиент готов к оформлению, зелёный акцент */
.order-btn-accent { background: #1d9a4a; }
.order-btn-accent:hover { background: #15803c; }

/* ── Помогаторы списков (Проекты/Заказы): буквы и диапазон дат ── */
.alpha-strip { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 10px; }
.alpha-strip button {
  min-width: 24px; padding: 3px 5px;
  border: 1px solid #e0e0e0; border-radius: 5px;
  background: #fafafa; font-size: 11px; font-weight: 600; color: #555; cursor: pointer;
}
.alpha-strip button:hover { border-color: #a8c0f8; color: #2f6fed; }
.alpha-strip button.active { border-color: #2f6fed; background: #eef3ff; color: #2f6fed; }

.date-range { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.date-range input[type="date"] {
  flex: 1; padding: 5px 6px; border: 1.5px solid #d0d7e3; border-radius: 6px;
  font-size: 12px; background: #f7f9fc;
}
.date-range span { color: #999; }
.date-range .opt-btn { flex: 0 0 auto; padding: 5px 9px; }


/* ── Профиль дверей купе ── */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

/* Цвета профиля дверей купе (задание «двери-начали 20,07») — круглые свотчи под сеткой видов */
.profile-colors {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.profile-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #d5d5d5;
  cursor: pointer;
  padding: 0;
}
.profile-color-btn:hover { border-color: #a8c0f8; }
.profile-color-btn.active { border-color: #2f6fed; box-shadow: 0 0 0 2px #eef3ff; }

/* ── Окно «Комбинированная дверь» (js/core/doorEditor.js) ── */
.door-editor-modal {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  width: min(680px, 92vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.door-editor-doors { display: flex; gap: 6px; flex-wrap: wrap; }
.door-editor-body { display: flex; gap: 18px; min-height: 0; }
#doorEditorSvg { flex-shrink: 0; align-self: flex-start; }
.door-editor-controls { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.door-editor-btn-row { display: flex; gap: 4px; flex-wrap: wrap; }
.door-editor-divider-row { display: flex; gap: 6px; align-items: center; }
.door-editor-fill-row {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 4px 6px; border-radius: 6px; border: 1.5px solid transparent; cursor: pointer;
}
.door-editor-fill-row:hover { background: #f4f7ff; }
.door-editor-fill-row.active { border-color: #2f6fed; background: #eef3ff; }
.door-editor-fill-row .el-row-label { min-width: 86px; }
/* Справа от селекта: селект цвета (ЛДСП/стекло) или название спеццвета (клик — переименовать) */
.door-editor-color-sel { max-width: 150px; }
.door-editor-fill-info { flex: 1; min-width: 0; font-size: 11px; color: #888; overflow-wrap: break-word; }
.door-editor-fill-info.renamable { color: #2f6fed; cursor: pointer; }
.door-editor-fill-info.renamable:hover { text-decoration: underline; }
.door-editor-fill-price { width: 74px; flex-shrink: 0; }
.door-editor-footer { flex-shrink: 0; display: flex; justify-content: flex-end; padding-top: 4px; }
.door-editor-footer .btn-primary { min-width: 160px; padding: 9px 18px; border-radius: 8px; }

.profile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 4px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  color: #666;
  transition: all 0.15s;
}

.profile-btn img {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.profile-btn span {
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.profile-btn:hover { border-color: #a8c0f8; color: #2f6fed; }
.profile-btn.active { border-color: #2f6fed; background: #eef3ff; color: #2f6fed; }

.perim-side { margin-bottom: 12px; }
.perim-label { display: block; font-size: 12px; font-weight: 600; color: #555; margin-bottom: 4px; }

/* ── Карточки популярных проектов ── */
.presets-list { display: flex; flex-direction: column; gap: 8px; }

.preset-card {
  position: relative;
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.preset-card:hover { border-color: #2f6fed; background: #eef3ff; }

/* Пользовательские шаблоны (задание «сохранять шаблоны 3,08») — свой оттенок + кнопка удаления. */
.preset-card-user { position: relative; border-color: #cdd9f5; background: #f6f9ff; }
.preset-del-btn {
  position: absolute; top: 4px; right: 6px;
  border: none; background: none; color: #aab; font-size: 17px; line-height: 1;
  cursor: pointer; padding: 2px 4px;
}
.preset-del-btn:hover { color: #c0392b; }

.preset-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
}

.preset-card-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
}

.preset-card-price {
  font-size: 13px;
  font-weight: 700;
  color: #2f6fed;
  margin-top: 6px;
}

/* ── Кнопка показа/скрытия дверей ── */
.toggle-doors-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}

.toggle-doors-btn:hover { border-color: #a8c0f8; color: #2f6fed; }
.toggle-doors-btn.active { border-color: #2f6fed; background: #eef3ff; color: #2f6fed; }

/* ── Группа кнопок-опций ── */
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.opt-btn {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.opt-btn:hover { border-color: #a8c0f8; color: #2f6fed; }
.opt-btn.active { border-color: #2f6fed; background: #eef3ff; color: #2f6fed; }
.opt-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.opt-btn:disabled:hover { border-color: #e0e0e0; color: #555; }

.side-replace-block {
  margin: 4px 0 8px 16px;
  padding: 8px 10px;
  border-left: 2px solid #e0e7f3;
  border-radius: 0 8px 8px 0;
  background: #f5f7fc;
}

/* ── Плейсхолдер вкладки ── */
.placeholder-note {
  margin-top: 20px;
  padding: 16px;
  background: #f5f6f8;
  border-radius: 8px;
  font-size: 13px;
  color: #888;
  line-height: 1.6;
}

/* ── Модальное окно заявки ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay.visible { display: flex; }

.order-modal {
  width: 360px;
  max-width: 90vw;
  background: #fff;
  border-radius: 10px;
  padding: 22px;
}

.order-modal h3 { margin: 0 0 14px; font-size: 17px; color: #222; }

.order-summary {
  font-size: 13px;
  color: #555;
  background: #f5f6f8;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.order-modal input[type="text"],
.order-modal input[type="password"] {
  width: 100%;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #ccc;
  padding: 0 10px;
  font-size: 14px;
}

.order-result { font-size: 13px; min-height: 18px; margin-bottom: 8px; }

.order-actions { display: flex; gap: 10px; margin-top: 10px; }

.btn-primary, .btn-secondary {
  flex: 1; padding: 10px;
  border-radius: 8px; border: none;
  font-size: 14px; cursor: pointer;
}

.btn-primary { background: #2f6fed; color: #fff; font-weight: 600; }

/* ── Секции наполнения ── */
.section-card {
  border: 1px solid #e4e4e4;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
/* Выбор кликом по карточке (не по полям/кнопкам внутри) — подсвечивает саму секцию в 3D
   (см. #sectionHighlight, js/core/dimensions.js), задание «интерфейс 19,07». */
.section-card.selected {
  border-color: #2f6fed;
  background: #eef4ff;
  box-shadow: 0 0 0 1px #2f6fed inset;
}

.section-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.section-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  flex-shrink: 0;
}

.section-collapse-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 2px;
  line-height: 0;
  flex-shrink: 0;
  display: flex;
}
.section-collapse-btn svg { transition: transform 0.15s; }
.section-collapse-btn.collapsed svg { transform: rotate(-90deg); }
.section-collapse-btn:hover { color: #2f6fed; }

.section-card-width {
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-card-width .dim-input { width: 64px; }

.section-card-unit { font-size: 13px; color: #888; }

.section-remove-btn {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 2px;
  line-height: 0;
  flex-shrink: 0;
}
.section-remove-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.section-remove-btn:disabled:hover { color: #ccc; }

.section-remove-btn:hover { color: #e44; }

.section-lock-btn {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  padding: 2px;
  line-height: 0;
  flex-shrink: 0;
}
.section-lock-btn:hover { color: #888; }
.section-lock-btn.active { color: #2f6fed; }

/* Внутреннее наполнение — по строке на тип элемента (полки/штанга/сетка/ящики/вешало),
   вся информация об элементе в одной линии. Текстовых подписей у под-полей нет — только
   title-подсказки при наведении, чтобы уместиться в узкую боковую панель. */
.section-rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.el-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px 0;
  border-bottom: 1px solid #eee;
}

.el-row:last-child { border-bottom: none; }

.el-row-label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  width: 56px;
  flex-shrink: 0;
}

.el-row-count {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  width: 16px;
  flex-shrink: 0;
  text-align: center;
}

/* Наполнение секции (полки/ящики/сетка/корзины/штанги) — теперь свободно перетаскиваемые мышкой
   элементы (см. js/core/itemDrag.js), а не счётчики: "+" добавляет экземпляр в первое свободное
   место секции по высоте (или тост, если места нет), крестик на чипе — удаляет конкретный. */
.section-add-btn {
  background: none;
  border: 1.5px solid #d0d7e3;
  border-radius: 5px;
  color: #2f6fed;
  cursor: pointer;
  width: 20px; height: 20px;
  line-height: 1;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.section-add-btn:hover { background: #eef3ff; }

.item-chip-remove {
  background: #f7f9fc;
  border: 1.5px solid #d0d7e3;
  border-radius: 5px;
  color: #999;
  cursor: pointer;
  width: 20px; height: 20px;
  line-height: 1;
  font-size: 13px;
  flex-shrink: 0;
}
.item-chip-remove:hover { color: #e44; border-color: #e44; }

/* Посегментная задняя стенка (см. tabs.js renderBackWallSegmentsRow) — компактные пронумерованные
   кнопки-переключатели, по одной на сегмент, снизу вверх. */
.section-backwall-seg-btn {
  background: #f7f9fc;
  border: 1.5px solid #d0d7e3;
  border-radius: 5px;
  color: #888;
  cursor: pointer;
  width: 20px; height: 20px;
  line-height: 1;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
.section-backwall-seg-btn:hover { border-color: #2f6fed; color: #2f6fed; }
.section-backwall-seg-btn.active { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.section-backwall-seg-btn.ineligible {
  background: #f0f0f0;
  border-color: #e0e0e0;
  color: #bbb;
  cursor: not-allowed;
  text-decoration: line-through;
}
.section-backwall-seg-btn.ineligible:hover { border-color: #e0e0e0; color: #bbb; }

.mini-input, .mini-select {
  border: 1.5px solid #d0d7e3;
  border-radius: 5px;
  background: #f7f9fc;
  font-size: 13px;
  font-weight: 600;
  color: #222;
  padding: 4px 2px;
  text-align: center;
}

.mini-input:focus, .mini-select:focus { outline: none; border-color: #2f6fed; background: #fff; }

.mini-input { width: 34px; padding-left: 1px; padding-right: 1px; }

.mini-input-wide { width: 44px; }

.mini-select { width: 58px; padding-left: 2px; }
.mini-select-wide { width: 96px; }

/* Ручка ящика «ручной цены» — название и цена заметно шире мелких mini-input (задание «поля мелкие») */
.section-drawer-handle-name-input { width: 140px; text-align: left; padding-left: 6px; padding-right: 6px; }
.section-drawer-handle-price-input { width: 66px; }

/* Селекты направляющих и ручки — во всю подпись, без обрезки «Скрыт…»/«Без руч…» (задание «не красиво») */
.section-drawer-slide-input { width: 148px; text-align: left; padding-left: 6px; }
.section-drawer-handle-input { width: 150px; text-align: left; padding-left: 6px; }

.el-row-check {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #555;
  flex-shrink: 0;
}

.el-row-check input { width: 16px; height: 16px; flex-shrink: 0; }
.btn-secondary { background: #eee; color: #333; }

/* ── Toast (короткие уведомления, напр. невалидный проём под корзину) ── */
.app-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: #2a2a2a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 1000;
  max-width: 320px;
  text-align: center;
}
.app-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Диалог выбора из нескольких вариантов (js/core/toast.js showChoiceDialog) — когда одного
   confirm() (да/нет) не хватает, например предупреждение о ящике за раздвижными дверями с
   вариантом «сузить смещающим элементом», задание «ящики-двери 19,07» ── */
.choice-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 30, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.choice-dialog-box {
  background: #fff;
  border-radius: 10px;
  padding: 20px 22px;
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.choice-dialog-text {
  font-size: 14px;
  color: #222;
  line-height: 1.5;
  margin-bottom: 16px;
}
.choice-dialog-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.choice-dialog-buttons .opt-btn {
  width: 100%;
}

/* ── Большое окно «Проекты» (js/core/projects.js, сессия 37) — тот же .overlay/.visible, что и
   у сохранения проекта, но крупный бокс с прокручиваемой сеткой карточек вместо узкой колонки
   в сайдбаре ── */
.projects-modal-box {
  width: min(1000px, 92vw);
  height: min(80vh, 760px);
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 36px rgba(0,0,0,0.3);
}

.projects-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.projects-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
}
.projects-modal-close:hover { color: #333; }

.projects-modal-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.projects-modal-controls select { width: 220px; }
.projects-modal-controls input[type="text"] { flex: 1; min-width: 200px; height: 34px; }
.projects-modal-controls .date-range { margin-bottom: 0; }

.projects-modal-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  align-content: start;
}
.projects-modal-grid .order-card { margin-bottom: 0; }

/* «Заказы» переиспользует .projects-modal-box (flex-column): список заказов — flex:1 растяжимая
   сетка со своим скроллом (как у «Проекты»), а этот блок ниже — фиксированной высоты (min-height:
   auto по умолчанию защищает его от сжатия), поэтому «Мои конфигурации»/«Выйти» всегда видны. */
.cabinet-modal-footer { flex-shrink: 0; }

/* ── Предпросмотр печати (js/core/print.js, задание «печать 19,07») — тот же оверлей, что и у
   «Проекты», внутри серый фон с белым «листом» по центру ── */
.print-modal-box {
  width: min(860px, 94vw);
  height: min(92vh, 1040px);
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 36px rgba(0,0,0,0.3);
}
.print-actions { display: flex; align-items: center; gap: 10px; }
.print-actions .btn-primary { padding: 8px 22px; border-radius: 8px; }
.print-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  background: #e9e9ec; border-radius: 8px; padding: 16px;
}
.print-sheet {
  background: #fff;
  max-width: 794px; /* ширина A4 при 96dpi — предпросмотр близок к тому, что выйдет на бумаге */
  margin: 0 auto;
  padding: 36px 40px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  font-size: 13px;
  color: #222;
  line-height: 1.5;
}
.print-head { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.print-meta { color: #666; margin-bottom: 14px; }
.print-img {
  display: block;
  width: 100%;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  margin-bottom: 4px;
}
.print-caption { color: #666; font-size: 12px; margin-bottom: 14px; }
.print-table .print-row-shown td { background: #eef3ff; font-weight: 600; }
.print-table { width: 100%; border-collapse: collapse; }
.print-table th, .print-table td {
  border: 1px solid #d8d8d8;
  padding: 6px 9px;
  text-align: left;
  vertical-align: top;
}
.print-table th { background: #f4f4f6; font-size: 12px; }
.print-table .print-num { width: 26px; text-align: center; }
.print-table .print-price { width: 110px; text-align: right; white-space: nowrap; }
.print-total { text-align: right; font-size: 16px; font-weight: 700; margin-top: 12px; }

/* Печать: виден только лист. Класс printing вешается на body на время window.print()
   (js/core/print.js) — всё приложение прячется, оверлей и лист теряют рамки/фоны/скроллы. */
@media print {
  body.printing > *:not(#printOverlay) { display: none !important; }
  body.printing #printOverlay { position: static; display: block; padding: 0; background: none; }
  body.printing .print-modal-box {
    width: auto; height: auto; padding: 0;
    box-shadow: none; border-radius: 0; display: block;
  }
  body.printing .projects-modal-header { display: none; }
  body.printing .print-scroll { overflow: visible; background: none; padding: 0; border-radius: 0; }
  body.printing .print-sheet { max-width: none; box-shadow: none; padding: 0; }
}

.order-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  background: #eee;
  margin-bottom: 8px;
}

/* ── Статус заказа (кабинет + админ) ── */
.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: #eee;
  color: #666;
}
.status-pill.status-new        { background: #eef1f4; color: #667; }
.status-pill.status-confirmed  { background: #e3ecff; color: #2f6fed; }
.status-pill.status-production { background: #fff0e0; color: #c07000; }
.status-pill.status-done       { background: #e3f7e8; color: #1e8a3c; }

/* ── Админ-панель ── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.admin-table th, .admin-table td {
  border-bottom: 1px solid #e4e4e4;
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.admin-contact { color: #888; font-size: 11px; }

/* ── Лого разработчика в углу экрана (задание «лого 21,07») ──────────────
   Файл лого — на сплошном чёрном фоне, поэтому оформлен как хром-плашка:
   скругление + тонкая светлая рамка + мягкая тень. Нижний-левый угол над
   3D-сценой (свободен: #undoBtn сверху, #sidebar/#panel справа).
   pointer-events:none — чтобы не перехватывать вращение сцены мышью. */
#devLogo {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: clamp(52px, 5vw, 68px);
  z-index: 30;
  pointer-events: none;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  line-height: 0;
  border: 1px solid rgba(196, 204, 214, 0.18);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  opacity: 0.32;
  user-select: none;
  -webkit-user-select: none;
}
#devLogo img {
  display: block;
  width: 100%;
  height: auto;
}
/* Мебельный бренд-акцент (line-эмблема шкафа + подпись) — над лого разработчика,
   в стиле иконок вкладок. Полупрозрачный, pointer-events:none (не мешает сцене). */
#brandMark {
  position: absolute;
  left: 18px;
  bottom: 92px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  color: #2c2c2c;
  opacity: 0.42;
}
#brandMark svg {
  width: 26px;
  height: 26px;
  flex: none;
}
#brandMark span {
  font: 600 12px/1.15 system-ui, "Segoe UI", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── Вкладка «Пользователи» (админ компании) — js/core/users.js ─────────────── */
#usersModalBody { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.users-add { border: 1px solid #e3e6ea; border-radius: 10px; padding: 12px 14px; background: #f8fafd; flex-shrink: 0; }
.users-form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.users-inp { flex: 1; min-width: 130px; }
.users-add-btn { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.users-msg { font-size: 12px; margin-top: 6px; color: #666; }
.users-msg.err { color: #c0392b; }
.users-msg.ok { color: #1f8a4c; }
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #eef0f3;
            border-radius: 10px; }
.user-row-edit { flex-direction: column; align-items: stretch; background: #f8fafd; }
.user-main { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 14px; }
.user-sub { color: #888; font-size: 12px; }
.user-tag { font-size: 10px; background: #e7edfb; color: #2f6fed; padding: 1px 7px; border-radius: 20px;
            vertical-align: middle; margin-left: 4px; }
.user-status { flex-shrink: 0; }
.user-actions { display: flex; gap: 6px; flex-shrink: 0; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.badge.on { background: #e5f5ea; color: #1f8a4c; }
.badge.off { background: #f3e6e6; color: #c0392b; }

/* «не доступен» — готовый тип, не подключённый компании (SaaS active_types, 2.6) */
.wip-label.locked-label { color: #8a8f98; }

/* ── «Поделиться» проектом/заказом (задание «поделиться 29,07», js/core/projects.js) ── */
/* Кнопки карточки — обе тянутся поровну и переносятся на 2 строки, если по ширине не влезают
   (задание 30,07: «поделиться и открыть» не помещались в узкую колонку). */
.order-card-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.order-card-actions .order-card-edit,
.order-card-actions .order-card-share { flex: 1 1 90px; min-width: 0; margin-top: 0; }
.order-card-share { padding: 6px 10px; border: 1px solid #cdd7ea; border-radius: 7px; background: #eef2fb;
                    color: #2f6fed; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.order-card-share:hover { background: #e2eafb; }
.order-card-shared { font-size: 11px; color: #a07000; margin-top: 3px; }
.order-card-shareinfo { font-size: 10px; color: #1f8a4c; margin-left: 4px; }
.order-card-lockers { font-size: 11px; color: #c0392b; margin-top: 3px; }

.share-popover { position: fixed; z-index: 3000; width: 300px; background: #fff; border: 1px solid #d0d7e3;
                 border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.22); padding: 12px; }
.share-pop-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
/* Поиск по сотруднику (задание «выбор список поделиться 4,08») — ник/ФИО/должность/почта. */
.share-pop-search { width: 100%; margin-bottom: 8px; }
.share-pop-list { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.share-pop-list label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.share-pop-row { align-items: flex-start !important; }
.share-pop-row input { margin-top: 2px; }
.share-pop-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.share-pop-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.share-pop-sub { font-size: 11px; color: #8a93a0; overflow: hidden; text-overflow: ellipsis; }
.share-pop-off { font-size: 10px; color: #c0392b; font-weight: 400; }
.share-pop-count { font-size: 11px; color: #6b7684; margin-top: 8px; }
.share-pop-empty { color: #999; font-size: 12px; }
.share-pop-actions { display: flex; gap: 8px; margin-top: 10px; }
.share-pop-save { flex: 1; padding: 7px; border: none; border-radius: 7px; background: #2f6fed; color: #fff;
                  font: inherit; font-weight: 600; cursor: pointer; }
.share-pop-cancel { padding: 7px 12px; border: 1px solid #ccd2da; border-radius: 7px; background: #fff;
                    font: inherit; cursor: pointer; }
.share-pop-msg { font-size: 12px; color: #c0392b; margin-top: 6px; }

/* ── Папки заказов + кнопки статуса (задание «поделиться 29,07») ── */
.order-folders { display: flex; gap: 6px; margin-bottom: 10px; flex-shrink: 0; }
.order-folder-btn { padding: 6px 12px; border: 1px solid #d0d7e3; border-radius: 8px; background: #f5f6f8;
                    color: #666; font: inherit; font-size: 13px; cursor: pointer; }
.order-folder-btn:hover { background: #eef2fb; }
.order-folder-btn.active { background: #2f6fed; color: #fff; border-color: #2f6fed; }
.order-card-status { flex: 1; padding: 6px 8px; border: 1px solid #cdd7ea; border-radius: 7px; background: #eef7ee;
                     color: #1f8a4c; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.order-card-status:hover { background: #dff0df; }
.order-card-status.warn { background: #fbeaea; color: #c0392b; border-color: #ecc; }
.order-card-status.warn:hover { background: #f6dede; }

/* Галочка «изменять нельзя» на карточке заказа (задание «поделиться 29,07») */
.order-card-lock { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px;
                   color: #c0392b; cursor: pointer; }
.order-card-lock input { cursor: pointer; }

/* Детали, не выходящие из листа материала (js/core/part-limits.js): предупреждение под ценой —
   размеры не зажимаем, просто показываем, что именно не режется из выбранного материала. */
.part-limit-warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 6px;
                   background: #fdf1e7; border: 1px solid #e8b98a; color: #8a4b12;
                   font-size: 12px; line-height: 1.35; }
.part-limit-head { font-weight: 600; margin-bottom: 3px; }
.part-limit-row { opacity: .9; }
