/* «Все модели»: копирование модели — кнопка в строке, окно, плашка результата. */

/* ── Кнопки действий в строке ── */
.page-models #tableModelsOverview .mo-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}

.page-models #tableModelsOverview .btn-copy-model {
  border-radius: 6px;
}

.page-models #tableModelsOverview .btn-copy-model:hover,
.page-models #tableModelsOverview .btn-copy-model:focus-visible {
  color: var(--df-primary);
}

.page-models #tableModelsOverview tbody tr.mo-row--copied > td {
  animation: mo-row-copied 2.4s ease-out;
}

@keyframes mo-row-copied {
  0%,
  35% {
    background-color: #e8f1ff;
  }
  100% {
    background-color: transparent;
  }
}

/* Тёмная подсказка над кнопкой (как в макете). */
.mo-tooltip {
  position: relative;
}

.mo-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 4px);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: #1f2937;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 5;
}

.mo-tooltip:hover::after,
.mo-tooltip:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Окно ── */
body.mcopy-open {
  overflow: hidden;
}

.mcopy {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mcopy[hidden] {
  display: none;
}

.mcopy__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.mcopy__dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: calc(100vh - 32px);
  background: var(--df-surface);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  color: var(--df-text);
}

.mcopy__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.6rem 1.75rem 0;
}

.mcopy__head-icon {
  display: inline-flex;
  color: var(--df-primary);
}

.mcopy__head-icon .icon-feather-action {
  width: 30px;
  height: 30px;
  stroke-width: 2;
}

.mcopy__title {
  margin: 0;
  flex: 1;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

.mcopy__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: -0.4rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}

.mcopy__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mcopy__close:hover {
  background: #f1f5f9;
  color: var(--df-text);
}

.mcopy__body {
  overflow-y: auto;
  padding: 0.5rem 1.75rem 1.25rem;
}

.mcopy__subtitle {
  margin: 0 0 1.1rem;
  color: #475569;
  font-size: 15px;
}

.mcopy-source {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.7rem;
  border: 1px solid var(--df-border);
  border-radius: 10px;
  background: #f6f8fb;
}

.mcopy-source__photo {
  flex: 0 0 auto;
  width: 112px;
  height: 112px;
  border-radius: 8px;
  overflow: hidden;
  background: #e9eef5;
}

.mcopy-source__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mcopy-source__photo-empty {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  box-sizing: border-box;
}

.mcopy-source__info {
  min-width: 0;
}

.mcopy-source__label {
  color: #64748b;
  font-size: 13px;
}

.mcopy-source__name {
  margin: 0.2rem 0 0.45rem;
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mcopy-source__meta {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.mcopy-source__meta b {
  color: #334155;
  font-weight: 600;
}

.mcopy__label {
  display: block;
  margin: 1.3rem 0 0.45rem;
  font-size: 15px;
  font-weight: 600;
}

.mcopy__req {
  color: var(--df-primary);
}

.mcopy__input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 0.9rem;
  border: 1.5px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
  color: var(--df-text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.mcopy__input::placeholder {
  color: #94a3b8;
}

.mcopy__input:focus {
  border-color: var(--df-primary);
  box-shadow: 0 0 0 3px rgba(1, 104, 250, 0.12);
}

.mcopy__input--error,
.mcopy__input--error:focus {
  border-color: var(--df-danger);
  box-shadow: 0 0 0 3px rgba(232, 80, 91, 0.12);
}

.mcopy__error {
  margin-top: 0.4rem;
  color: var(--df-danger);
  font-size: 13px;
}

.mcopy__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.35rem 0 0.6rem;
}

.mcopy__section-title {
  font-size: 15px;
  font-weight: 600;
}

.mcopy__select-all {
  border: none;
  background: transparent;
  padding: 0.15rem 0;
  color: var(--df-primary);
  font-size: 14px;
  cursor: pointer;
}

.mcopy__select-all:hover {
  color: var(--df-primary-strong);
  text-decoration: underline;
}

.mcopy__select-all:disabled {
  color: #94a3b8;
  cursor: default;
  text-decoration: none;
}

.mcopy__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
}

.mcopy__col {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mcopy-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.2rem 0;
  cursor: pointer;
}

.mcopy-opt--locked {
  cursor: default;
}

.mcopy-opt__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.mcopy-opt__box {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #fff;
  box-sizing: border-box;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.mcopy-opt__box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.mcopy-opt__input:checked + .mcopy-opt__box {
  border-color: var(--df-primary);
  background: var(--df-primary);
}

.mcopy-opt__input:checked + .mcopy-opt__box svg {
  opacity: 1;
}

.mcopy-opt__input[data-locked]:checked + .mcopy-opt__box {
  border-color: #8fb6f5;
  background: #8fb6f5;
}

.mcopy-opt__input:focus-visible + .mcopy-opt__box {
  box-shadow: 0 0 0 3px rgba(1, 104, 250, 0.2);
}

.mcopy-opt__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 0.1rem;
}

.mcopy-opt__label {
  font-size: 15px;
  line-height: 1.3;
}

.mcopy-opt__hint {
  margin-top: 0.1rem;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.3;
}

.mcopy__info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.2rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: #eef4ff;
  color: #475569;
  font-size: 14px;
}

.mcopy__info svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--df-primary);
  stroke-width: 2;
  stroke-linecap: round;
}

.mcopy__foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.75rem 1.3rem;
  border-top: 1px solid var(--df-border);
}

.mcopy__btn {
  min-width: 132px;
  height: 42px;
  font-size: 15px;
}

.mcopy__btn.btn--primary:disabled {
  background: #9cc1f8;
  border-color: #9cc1f8;
  cursor: not-allowed;
}

@media (max-width: 560px) {
  .mcopy__grid {
    grid-template-columns: 1fr;
    row-gap: 0.55rem;
  }

  .mcopy__head,
  .mcopy__body,
  .mcopy__foot {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .mcopy-source__photo {
    width: 80px;
    height: 80px;
  }
}

/* ── Плашка «Копия модели создана» ── */
.mcopy-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: min(440px, calc(100vw - 32px));
  padding: 0.95rem 1rem 0.95rem 1.1rem;
  border: 1px solid #bfe6cc;
  border-radius: 12px;
  background: #effaf3;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mcopy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mcopy-toast__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
}

.mcopy-toast__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mcopy-toast__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.mcopy-toast__title {
  color: var(--df-text);
  font-size: 15px;
  font-weight: 600;
}

.mcopy-toast__sub {
  margin-top: 0.15rem;
  color: #475569;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.mcopy-toast__close {
  flex: 0 0 auto;
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}

.mcopy-toast__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.mcopy-toast__close:hover {
  background: rgba(22, 163, 74, 0.1);
}
