/* Утилиты */
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.inline { display: inline-flex; align-items: center; gap: 8px; margin-right: 12px; }
.inline .lbl { min-width: 140px; color: #444; }

/* контейнер шире */
.container {
  max-width: 1200px;     /* было меньше/не было вовсе */
  margin: 0 auto;
  padding: 0 24px;
}

/* таблица — гибкая, вторая колонка занимает всё */
table.tasks{
  width: 500px;
  border-collapse: collapse;
  table-layout: auto;    /* не fixed */
  margin-top: 12px;
}
table.tasks th:first-child,
table.tasks td:first-child { width: 56px; }

textarea.task-line{
  width: 100%;
  min-height: 140px;     /* выше по умолчанию */
  line-height: 1.5;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  resize: vertical;
  font: inherit;
  background: #fff;
}


.editor input.mentionable,
.editor input.dateable {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

/* Нижний предпросмотр */
.preview-pane {
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.preview-actions { margin-bottom: 16px; }

/* Кнопки */
.buttons button, .btn-upload,.btn-download, .tracker-form button {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
.buttons button:hover, .btn-download:hover, .tracker-form button:hover {
  background: #1d4ed8;
}

/* Контейнер ячейки задачи */
.task-cell{ position: relative; overflow: visible; }
textarea.task-line{
  width: 100%;
  min-height: 120px;           /* выше по умолчанию */
  line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  resize: vertical;
  font: inherit;
  background: #fff;
}

/* Выпадашка упоминаний — новая версия */
/* Выпадашка упоминаний — форсируем нужный вид */
#mention-box { background:#fff !important; border:1px solid #cbd5e1 !important; border-radius:10px; box-shadow:0 16px 32px rgba(0,0,0,.18); z-index:20000; }
#mention-box .mention-list{ max-height:300px; overflow-y:auto; padding:4px 0; background:#fff; }
#mention-box .mention-item{
  display:flex; align-items:center; gap:8px;
  padding:10px 12px; cursor:pointer;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#mention-box .mention-item:hover,
#mention-box .mention-item.active{ background:#eef2ff; }
#mention-box .mention-name{ font-weight:600; }
#mention-box .mention-login{ font-size:12px; color:#667085; }
#mention-box .mention-sep{ color:#94a3b8; font-size:12px; }
#mention-box .mention-footer{ border-top:1px solid #e2e8f0; background:#f8fafc; font-size:12px; color:#64748b; padding:8px 12px; }

/* глушим любые "аватары" из старых версий */
#mention-box .mention-avatar, #mention-box .mi-avatar, #mention-box .initials{ display:none !important; }
/* универсальная скрывашка с самым высоким приоритетом */
.hidden { display: none !important; }
#mention-box.hidden { display: none !important; }

.trk{ width:100%; border-collapse:collapse; margin-top:10px; }
.trk th,.trk td{ border:1px solid #e5e7eb; padding:8px; vertical-align:middle; }
.trk .ro{ width:100%; background:#f8fafc; border:0; padding:6px 8px; border-radius:6px; }
.trk select{ width:100%; padding:6px 8px; border:1px solid #d1d5db; border-radius:6px; }

.buttons{ display:flex; gap:12px; align-items:center; }
.btn-primary{ padding:10px 14px; border-radius:8px; background:#2563eb; color:#fff; border:0; cursor:pointer; }
.btn-primary:hover{ background:#1d4ed8; }

.btn-secondary{
  padding:10px 14px; border-radius:8px; border:1px solid #d1d5db;
  background:#fff; color:#111827; cursor:pointer;
}
.btn-secondary:hover{ background:#f8fafc; }

/* Уже есть: .editor .tasks col.w-text { width: 500px } */
:root{
  --num-col: 54px;   /* ширина левой колонки с номером и крестиком (подберите 48–60) */
  --gap: 6px;        /* небольшой внутренний отступ справа от номера */
}

.editor .tasks col.w-num  { width: var(--num-col) !important; }  /* уже узкая колонка слева */

.editor .tasks td { padding: 4px 6px; vertical-align: top; }
/* Ячейка с номером и крестиком — без лишних отступов */
.editor .tasks td.num-cell{
  width: var(--num-col) !important;
  padding: 0 !important;
  position: relative;
}
.editor .tasks td.task-cell{
  padding-left: var(--gap) !important;
}
/* поле ближе к номеру */

.editor .task-cell > textarea.task-line{
  margin-left: 0 !important;
}

/* Номер + крестик — по центру ячейки по вертикали, у левого края по горизонтали */
.task-num{
  position: absolute;
  left: 6px;                /* «с левого края» */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

/* Цифра */
.task-num .n{
  font-weight: 600;
  color:#111827;
  line-height: 1;
  text-align: left;
}

/* Кнопка удаления — красный кружок с белым крестиком, по центру текста */
.row-del{
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: none;
  background:#ef4444;       /* красный фон */
  color:#fff;               /* белый крестик */
  font-weight:700; line-height:1;
  cursor: pointer;
  box-shadow: 0 0 0 1px #f87171 inset;  /* тонкая окантовка */
}
.row-del:hover{ background:#dc2626; }
.row-del:focus-visible{ outline: 2px solid #fecaca; outline-offset: 2px; }

/* Настраиваем ширины колонок через <colgroup> и глушим старые правила */
:root{
  --num-col: 20px;  /* сколько нужно на номер + крестик */
  --gap: 6px;       /* зазор между номером и полем */
}

.editor .tasks {
  width: 100%;
  table-layout: fixed !important;
}

/* ширина первой колонки берётся из <col class="w-num"> */
.editor .tasks col.w-num  { width: var(--num-col) !important; }
/* вторая колока занимает всё остальное */
.editor .tasks col.w-text { width: auto !important; }

/* переопределяем прежнее правило first-child, которое держало 56px */
.editor table.tasks th:first-child,
.editor table.tasks td:first-child {
  width: var(--num-col) !important;
}

/* убираем «воздух» вокруг */
.editor .tasks td.num-cell{
  padding: 0 !important;
  position: relative;
}
.editor .tasks td.task-cell{
  padding-left: var(--gap) !important; /* небольшой зазор от номера до поля */
}

/* у самого textarea не должно быть внешнего отступа слева */
.editor .task-cell > textarea.task-line{
  margin-left: 0 !important;
}

/* Глобальные переменные для логотипа */
:root{
  --app-logo-url: url("/demo/static/logo.svg");   /* путь к вашему лого */
  --app-logo-size: clamp(240px, 40vmin, 560px);  /* размер лого */
  --app-logo-opacity: 0.06;                  /* прозрачность 0..1 */
}

/* Водяной знак на всех страницах */
html, body { min-height: 100%; }
body { position: relative; }

/* Сам логотип фоном поверх body, но ниже контента */
body::after{
  content:"";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: var(--app-logo-opacity);

  background-image: var(--app-logo-url), var(--app-logo-url);
  background-repeat: repeat, repeat;
  background-size: 160px 160px, 160px 160px;
  background-position: 0 0, 80px 80px;  /* второй слой сдвинут */
}


/* Поднимаем ваш основной контейнер над водяным знаком */
.container { position: relative; z-index: 1; }


/* ===== Индикатор загрузки (оверлей) ===== */
    .loading-overlay {
      position: fixed;
      inset: 0;
      background: rgba(255,255,255,.85);
      backdrop-filter: blur(2px);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      z-index: 30000;
      opacity: 1;
      transition: opacity .2s ease;
    }
    .loading-overlay.hidden {
      opacity: 0;
      pointer-events: none;
    }
    .spinner {
      width: 56px; height: 56px;
      border: 6px solid #e5e7eb;
      border-top-color: #3b82f6;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    .loading-text {
      margin-top: 12px;
      font: 500 14px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial;
      color: #374151;
      text-align: center;
    }


/* При печати воду убираем (если нужно) */
@media print {
  body::after{ display: none; }
}

/* (опционально) поддержка тёмной темы – делаем логотип чуть светлее */
@media (prefers-color-scheme: dark){
  :root{ --app-logo-opacity: 0.08; }
}
