/* Всплывающие окна: модалка «Передать», попап статусов/действий у строки, тост «Готово». */

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.modal[hidden] { display: none; }
/* при открытом сайдбаре центрируем окно по видимой области (правее панели) */
body.sidebar-open .modal { padding-left: var(--sidebar-w); }
@media (max-width: 900px) { body.sidebar-open .modal { padding-left: 0; } }
.modal__inner {
  background: var(--surface); padding: 20px; border-radius: 10px; min-width: 320px;
  border: 1px solid var(--border);
  max-height: 90vh; overflow-y: auto;
}
.modal__inner--wide { min-width: 480px; max-width: 640px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- ПОПАП СТАТУСОВ / ДЕЙСТВИЙ (наведение на середину строки) ---------- */
/* компактное окно: только иконки статусов и действий, подписи — на hover */
/* Попап у строки (НЕ модалка): #details-modal — прозрачный слой на весь экран
   (ловит клик-вне, чтобы закрыть). #details-inner — компактное окошко в одну
   строку, позиционируется из JS (positionDetails) над кликнутой строкой. */
#details-modal { background: transparent; }
#details-inner {
  position: absolute;
  min-width: 0;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
/* всё в одну строку: действия · разделитель · статусы */
.dm-icon-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 0px; }
/* только смайлики, без обводки; компактно */
.dm-icon-btn {
  width: 24px; height: 32px;
  border: none; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-mute); font-size: 15px; line-height: 1;
  transition: transform .1s, opacity .12s;
}
.dm-icon-btn:hover:not(:disabled) { transform: scale(1.15); }
.dm-icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.dm-icon-btn img { width: 18px; height: 18px; object-fit: contain; }
.dm-icon-btn--undo { font-size: 17px; }

/* ---------- TOAST-LAYER (undo для «Готово») ---------- */
.toast-layer {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
  min-width: 280px; max-width: 380px;
  font-size: 13px;
  animation: toast-in .18s ease-out;
}
.toast--leaving { animation: toast-out .18s ease-in forwards; }
/* тосты админки (admin.js): результат сохранения формы без перезагрузки */
.toast--success { border-color: var(--ok); }
.toast--error   { border-color: var(--danger); }
.toast--error .toast__text { color: var(--danger); }
@keyframes toast-in  { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to   { transform: translateX(20px); opacity: 0; } }
.toast__text { flex: 1 1 auto; color: var(--text); }
.toast__count { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.toast__undo {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: background-color .12s, color .12s;
}
.toast__undo:hover { background: var(--accent); color: var(--accent-fg); }
.toast__confirm {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
  cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: filter .12s;
}
.toast__confirm:hover { filter: brightness(1.1); }
