/* ═══════════════════════════════════════════════════════════════════
   Стили массовых действий (bulk actions): плавающая/инлайн-панель,
   модалки «Изменить статус» / «Назначить ответственного» / «Массовый
   ответ» + композер ответа (compose-mode, reply-status, rich-select
   шаблонов, icon-badge). Вынесено из index.html, чтобы не перегружать
   страницу. Подключается ПОСЛЕ css/filters-modal.css (там базовый
   .filters-modal, который .filters-modal.bulk-modal перекрывает).
   ═══════════════════════════════════════════════════════════════════ */
/* МАССОВЫЕ ДЕЙСТВИЯ - ПЛАВАЮЩАЯ ПАНЕЛЬ */
.bulk-actions-bar{
  position:fixed;
  bottom:30px;
  left:50%;
  transform:translateX(-50%);
  background:#fff;
  border-radius:16px;
  box-shadow:0 8px 32px rgba(0,0,0,.15);
  padding:16px 24px;
  display:none;
  align-items:center;
  gap:20px;
  z-index:100;
  border:2px solid #e5e7eb;
  display:none !important;
}

.bulk-actions-bar.show{
  display:flex;
  animation:slideUp 0.3s ease-out;
}

@keyframes slideUp{
  from{
    opacity:0;
    transform:translateX(-50%) translateY(20px);
  }
  to{
    opacity:1;
    transform:translateX(-50%) translateY(0);
  }
}

.bulk-actions-info{
  font-size:14px;
  color:#374151;
  font-weight:600;
}

.bulk-actions-buttons{
  display:flex;
  gap:10px;
}

.bulk-actions-inline{
  display:none;
  align-items:center;
  gap:12px;
  margin:-6px 0 12px;
  padding:10px 12px;
  background:#ffffff;
  border:1px solid #dbe5f0;
  border-radius:12px;
  box-shadow:0 2px 8px rgba(15,23,42,.08);
}

.bulk-actions-inline.show{
  display:flex;
}

.bulk-actions-inline .bulk-actions-buttons{
  margin-left:8px;
}

.bulk-actions-inline .bulk-close-btn{
  margin-left:auto;
  width:30px;
  height:30px;
  padding:0;
  border-radius:8px;
  border:1px solid #d1d5db;
  background:#f3f4f6;
  color:#6b7280;
  font-size:18px;
  font-weight:700;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 2px 6px rgba(2,8,23,.08);
}

.bulk-actions-inline .bulk-close-btn:hover{
  background:#e5e7eb;
  color:#374151;
  border-color:#9ca3af;
}

.bulk-action-btn{
  display:flex;
  align-items:center;
  gap:7px;
  padding:9px 14px;
  background:#fff;
  border:1px solid #dbe5f0;
  border-radius:10px;
  font-size:13px;
  font-weight:600;
  color:#374151;
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
}

.bulk-action-btn svg{
  width:16px;
  height:16px;
  flex:none;
  stroke:var(--brand-primary);
  fill:none;
  transition:stroke .18s ease;
}

.bulk-action-btn:hover{
  background:var(--brand-primary-tint);
  border-color:var(--brand-primary-soft);
  color:var(--brand-primary-dark);
  box-shadow:0 2px 8px rgba(99,102,241,.16);
  transform:translateY(-1px);
}
.bulk-action-btn:active{
  transform:translateY(0);
  box-shadow:0 1px 2px rgba(15,23,42,.05);
}

.bulk-delete-btn{color:#dc2626}
.bulk-delete-btn svg{stroke:#dc2626}
.bulk-delete-btn:hover{
  background:#fef2f2;
  border-color:#fecaca;
  color:#dc2626;
  box-shadow:0 2px 8px rgba(220,38,38,.16);
}
.bulk-delete-btn:hover svg{stroke:#dc2626}

.bulk-close-btn{
  margin-left:10px;
  padding:8px;
  background:transparent;
  border:none;
  cursor:pointer;
  color:#9ca3af;
  transition:color .2s;
}

.bulk-close-btn:hover{
  color:#374151;
}

.bulk-modal .filters-content{
  max-width:560px;
}

.bulk-modal .filters-title{
  margin-bottom:0;
}

.filters-modal.bulk-modal{
  background:rgba(15,23,42,.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index:12000;
  overflow:hidden;
}

.filters-modal.bulk-modal.show{
  display:block;
}

.filters-modal.bulk-modal .filters-content{
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%, -50%);
  width:min(560px, calc(100vw - 32px));
  max-height:calc(100vh - 48px);
  overflow-y:auto;
  overscroll-behavior:contain;
  border:1px solid #e5e7eb;
  box-shadow:0 12px 28px rgba(2,8,23,.24);
  font-family:Inter,Arial,system-ui;
}

/* Массовый ответ: обертка + карточка 1:1 по блоку "Новый ответ" */
#bulkReplyModal .filters-content{
  width:min(980px, calc(100vw - 32px));
  max-width:none;
  padding:0;
  background:transparent;
  box-shadow:none;
  border:none;
  border-radius:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  max-height:calc(100vh - 32px);
  font-family:Inter,Arial,system-ui;
}

#bulkReplyModal .bulk-reply-wrap{
  position:relative;
  width:100%;
  margin:0 auto;
}

#bulkReplyModal .bulk-reply-close{
  position:absolute;
  /* по вертикали — центр шапки (≈ центр текста «Массовый ответ»):
     padding-top reply-section 24px + половина высоты шапки ~18px = 42px;
     transform центрирует кнопку относительно этой точки. */
  top:42px;
  right:14px;
  transform:translateY(-50%);
  width:28px;
  height:28px;
  border:none;
  background:transparent;
  border-radius:8px;
  color:#9ca3af;
  font-size:20px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:5;
}

#bulkReplyModal .reply-section > div:first-child{
  padding-right:56px;
}

#bulkReplyModal .bulk-reply-close:hover{
  background:#f3f4f6;
  color:#6b7280;
}

.bulk-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:18px;
}

/* Кнопки модалок — системный стиль (как .reply-submit/.new-ticket-btn):
   вторичная «Отмена» с hover-подсветкой, первичная — индиго-градиент
   с hover-lift и active-press. */
.bulk-modal-cancel{
  padding:10px 16px;
  border:1px solid #dbe5f0;
  background:#fff;
  border-radius:10px;
  color:#374151;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
  transition:background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.bulk-modal-cancel:hover{
  background:var(--brand-primary-tint);
  border-color:var(--brand-primary-soft);
  color:var(--brand-primary-dark);
  transform:translateY(-1px);
}
.bulk-modal-cancel:active{ transform:translateY(0); }

.bulk-modal-submit{
  position:relative;
  padding:10px 18px;
  min-width:120px;
  border:none;
  background:linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  border-radius:10px;
  color:#fff;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  transition:background .22s ease, box-shadow .22s ease, transform .22s ease;
  box-shadow:0 2px 6px rgba(99,102,241,.18), 0 4px 12px rgba(99,102,241,.10);
}
.bulk-modal-submit:hover{
  background:linear-gradient(180deg, #7274f4 0%, #4f46e5 100%);
  box-shadow:0 4px 10px rgba(99,102,241,.26), 0 6px 18px rgba(99,102,241,.16);
  transform:translateY(-1px);
}
.bulk-modal-submit:active{
  background:linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  transform:translateY(0);
  box-shadow:inset 0 1px 2px rgba(20,16,80,.20), 0 1px 3px rgba(99,102,241,.15);
}

.bulk-modal-submit:disabled{
  background:linear-gradient(180deg, #cbd5e1 0%, #94a3b8 100%);
  color:#f1f5f9;
  opacity:.7;
  cursor:not-allowed;
  box-shadow:none;
  transform:none;
}

/* Опасная вариация (удаление) — красный градиент вместо инлайн-цвета. */
.bulk-modal-submit.danger{
  background:linear-gradient(180deg, #f87171 0%, #dc2626 100%);
  box-shadow:0 2px 6px rgba(220,38,38,.18), 0 4px 12px rgba(220,38,38,.10);
}
.bulk-modal-submit.danger:hover{
  background:linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow:0 4px 10px rgba(220,38,38,.26), 0 6px 18px rgba(220,38,38,.16);
}
.bulk-modal-submit.danger:active{
  background:linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
}

.bulk-status-options{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

/* Богатые цветные чипы статуса: всегда показывают цветную иконку
   (зелёный=открыт, жёлтый=в ожидании, красный=закрыт), при выборе —
   заливка тоном статуса + цветная рамка и текст. */
.bulk-status-option{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1.5px solid #e5e7eb;
  background:#fff;
  color:#475569;
  border-radius:10px;
  padding:9px 14px;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(15,23,42,.05);
  transition:background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.bulk-status-option .bulk-status-ic{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  flex:none;
}
.bulk-status-option .bulk-status-ic svg{ width:18px; height:18px; }
.bulk-status-option:hover{ transform:translateY(-1px); }
.bulk-status-option:active{ transform:translateY(0); }

/* акцентные цвета иконок (видны всегда) */
.bulk-status-option.open    .bulk-status-ic{ color:#16a34a; }
.bulk-status-option.pending .bulk-status-ic{ color:#d97706; }
.bulk-status-option.closed  .bulk-status-ic{ color:#dc2626; }

/* hover — лёгкая тонировка тоном статуса */
.bulk-status-option.open:hover{    border-color:#86efac; background:#f0fdf4; color:#15803d; }
.bulk-status-option.pending:hover{ border-color:#fcd34d; background:#fffbeb; color:#b45309; }
.bulk-status-option.closed:hover{  border-color:#fca5a5; background:#fef2f2; color:#b91c1c; }

/* выбранное состояние — насыщенная заливка тоном статуса */
.bulk-status-option.open.active{
  border-color:#22c55e; background:#dcfce7; color:#15803d;
  box-shadow:0 4px 12px rgba(22,163,74,.20), 0 2px 6px rgba(2,8,23,.06);
}
.bulk-status-option.pending.active{
  border-color:#f59e0b; background:#fef3c7; color:#b45309;
  box-shadow:0 4px 12px rgba(217,119,6,.20), 0 2px 6px rgba(2,8,23,.06);
}
.bulk-status-option.closed.active{
  border-color:#ef4444; background:#fee2e2; color:#b91c1c;
  box-shadow:0 4px 12px rgba(220,38,38,.20), 0 2px 6px rgba(2,8,23,.06);
}
.bulk-status-option.active .bulk-status-ic{ color:inherit; }

.bulk-help-text{
  font-size:12px;
  color:#6b7280;
  margin-top:8px;
}

.bulk-reply-shell{
  margin-top:0;
}

.template-selector{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
}

.template-label{
  font-size:13px;
  color:#6b7280;
  font-weight:500;
}

.template-select{
  padding:6px 10px;
  border:1px solid #d1d5db;
  border-radius:6px;
  font-size:13px;
  background:#fff;
  color:#374151;
  cursor:pointer;
  outline:none;
  transition:border .2s;
}

.template-select:hover, .template-select:focus{
  border-color:var(--brand-primary);
}

.reply-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}

.reply-left{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1;
  flex-wrap:wrap;
}

.attach-file{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:500;
  line-height:1.2;
  color:#374151;
  cursor:pointer;
  padding:6px 10px 6px 6px;
  border-radius:8px;
  transition:background .2s, color .15s;
}
.attach-file:hover{
  background:#f3f4f6;
  color:#111827;
}

/* Универсальный мини-бейдж: круглый индиго-gradient + белая SVG-иконка
   (как в композере тикета — для скрепки и шапки списка файлов). */
.icon-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:50%;
  background:linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  color:#fff;
  box-shadow:0 1px 2px rgba(99,102,241,.30), 0 2px 6px rgba(99,102,241,.18);
  flex-shrink:0;
  vertical-align:middle;
}
.icon-badge svg{
  width:12px;
  height:12px;
  stroke:currentColor;
  fill:none;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.status-selector{
  display:flex;
  gap:12px;
  align-items:center;
  padding:0;
  background:transparent;
  border-radius:0;
  border:none;
}

.status-option{
  font-size:14px;
  color:#6b7280;
  cursor:pointer;
  padding:6px 16px;
  border-radius:6px;
  transition:all .2s;
  user-select:none;
  background:transparent;
  border:2px solid #d1d5db;
  font-weight:600;
}

.status-option:hover{
  color:#111827;
  background:#f3f4f6;
  border-color:#9ca3af;
}

.status-option.active{
  color:#fff;
  border-color:var(--brand-primary);
  background:var(--brand-primary);
}

.status-option.pending.active{
  border-color:#d97706;
  background:#d97706;
  box-shadow:0 4px 12px rgba(217,119,6,.28), 0 2px 6px rgba(2,8,23,.10);
}

.status-option.closed.active{
  border-color:#dc2626;
  background:#dc2626;
  box-shadow:0 4px 12px rgba(220,38,38,.28), 0 2px 6px rgba(2,8,23,.10);
}

.reply-submit{
  padding:10px 24px;
  background:linear-gradient(180deg, #6366f1 0%, #4f46e5 100%);
  border:none;
  border-radius:8px;
  font-size:14px;
  font-weight:600;
  color:#fff;
  cursor:pointer;
  transition:background .22s ease, box-shadow .22s ease, transform .22s ease;
  white-space:nowrap;
  box-shadow:0 2px 6px rgba(99,102,241,.18), 0 4px 12px rgba(99,102,241,.10);
}
.reply-submit:hover{
  background:linear-gradient(180deg, #7274f4 0%, #4f46e5 100%);
  box-shadow:0 4px 10px rgba(99,102,241,.26), 0 6px 18px rgba(99,102,241,.16);
  transform:translateY(-1px);
}
.reply-submit:active{
  background:linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  transform:translateY(0);
  box-shadow:inset 0 1px 2px rgba(20,16,80,.20), 0 1px 3px rgba(99,102,241,.15);
}

.editor-toolbar{
  background:#ffffff;
  padding:12px 16px;
  border-radius:14px 14px 0 0;
  border:1px solid #e5e7eb;
  border-bottom:none;
}

#bulkReplyModal .bulk-editor-toolbar{
  background:#ffffff;
  padding:12px 16px;
  border-radius:14px 14px 0 0;
  border:1px solid #e5e7eb;
  border-bottom:none;
}

#bulkReplyModal .template-label{
  font-size:13px;
  color:#6b7280;
  font-weight:500;
}

#bulkReplyModal .template-select{
  min-width:0;
  width:620px;
  max-width:100%;
}

#bulkReplyModal .ql-toolbar.ql-snow{
  border:none;
  padding:0;
  border-left:1px solid #e5e7eb;
  border-right:1px solid #e5e7eb;
  border-top:1px solid #e5e7eb;
  border-bottom:1px solid #e5e7eb;
  box-sizing:border-box;
}

#bulkReplyModal .ql-toolbar button{
  width:36px;
  height:36px;
  border-radius:10px;
  transition:all .18s ease;
}

#bulkReplyModal .ql-toolbar button svg{
  width:18px;
  height:18px;
}

#bulkReplyModal .ql-toolbar button:hover{
  background:#f3f4f6;
}

#bulkReplyModal .ql-toolbar button.ql-active{
  background:var(--brand-primary);
}

#bulkReplyModal .ql-toolbar button.ql-active .ql-stroke{
  stroke:#ffffff;
}

#bulkReplyModal .ql-toolbar button.ql-active .ql-fill{
  fill:#ffffff;
}

#bulkReplyModal .ql-toolbar .ql-stroke{
  transition:stroke .2s ease;
}

#bulkReplyModal .ql-toolbar button:hover .ql-stroke{
  stroke:var(--brand-primary);
}

#bulkReplyEditor{
  background:#ffffff;
  border:1px solid #e5e7eb;
  border-top:none;
  border-radius:0 0 14px 14px;
  min-height:180px;
  box-shadow:0 12px 32px rgba(0,0,0,0.05);
  transition:all .2s ease;
}

#bulkReplyEditor:focus-within{
  border-color:var(--brand-primary);
  box-shadow:0 16px 40px rgba(58,85,232,0.18);
}

/* ── Массовый ответ 1:1 с композером тикета: rich-select шаблонов,
   compose-mode dropdown (Ответ/Внутренний), reply-status dropdown ── */
#bulkReplyModal .template-rich-select{ min-width:240px; }
/* ширина меню шаблонов как в тикете — фикс 284px (JS ставит инлайном
   width:auto + min-width = ширине кнопки, перебиваем !important). */
#bulkTemplateSelectMenu{ width:284px !important; min-width:284px !important; }
#bulkReplyModal .template-rich-select .rich-select-btn{
  width:100%;
  padding:6px 12px;
  height:30px;
  border:1.5px solid #e5e7eb;
  border-radius:8px;
  font-size:13px;
  font-weight:400;
  line-height:1.2;
  color:#374151;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
  transition:border-color .18s ease, box-shadow .18s ease;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
#bulkReplyModal .template-rich-select .rich-select-btn:hover{
  border-color:#9bbfe0;
  box-shadow:0 1px 5px rgba(79,134,198,.14);
}
#bulkReplyModal .template-rich-select .rich-select-btn[aria-expanded="true"]{
  border-color:#6366f1;
  box-shadow:0 0 0 3px rgba(99,102,241,.15);
}
#bulkTemplateSelectMenu .rich-select-item{ font-size:13px; padding:7px 10px; }

/* compose-mode dropdown */
.compose-mode-wrap{ position:relative; display:inline-block; font-family:'Segoe UI',Arial,sans-serif; }
.compose-mode-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px 7px 12px;
  min-height:34px;
  background:linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(248,250,252,.85) 100%);
  backdrop-filter:blur(10px) saturate(140%);
  -webkit-backdrop-filter:blur(10px) saturate(140%);
  border:1px solid rgba(203,213,225,.65);
  border-radius:8px;
  font-size:13px;
  font-weight:500;
  color:#111827;
  cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(15,23,42,.04), 0 2px 6px rgba(15,23,42,.04);
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.compose-mode-btn:hover{
  border-color:rgba(99,102,241,.40);
  background:linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(238,242,255,.85) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,1), 0 2px 4px rgba(15,23,42,.06), 0 4px 12px rgba(99,102,241,.10);
}
.compose-mode-btn[aria-expanded="true"]{
  border-color:#6366f1;
  box-shadow:inset 0 1px 0 rgba(255,255,255,1), 0 0 0 3px rgba(99,102,241,.15);
}
.compose-mode-btn .cmode-icon{ display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; flex-shrink:0; }
.compose-mode-btn .cmode-label{ white-space:nowrap; }
.compose-mode-btn .cmode-chevron{ color:#6b7280; transition:transform .15s; flex-shrink:0; }
.compose-mode-btn[aria-expanded="true"] .cmode-chevron{ transform:rotate(180deg); }

/* в bulk-модалке кнопка режима сверху — меню раскрываем ВНИЗ
   (в тикете composer внизу страницы и меню идёт вверх). */
#bulkReplyModal .compose-mode-menu{
  position:absolute;
  top:calc(100% + 6px);
  bottom:auto;
  left:auto;
  right:0;
  min-width:340px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
  box-shadow:0 10px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  padding:6px;
  z-index:60;
  animation:cmodeFadeIn .12s ease-out;
}
@keyframes cmodeFadeIn{ from{opacity:0;transform:translateY(4px);} to{opacity:1;transform:translateY(0);} }
.cmode-item{
  display:flex; align-items:flex-start; gap:10px; width:100%;
  padding:10px; background:transparent; border:0; border-radius:8px;
  text-align:left; cursor:pointer; font-family:inherit; transition:background .1s;
}
.cmode-item + .cmode-item{ margin-top:2px; }
.cmode-item:hover{ background:#f3f4f6; }
.cmode-item-icon{ display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:8px; flex-shrink:0; margin-top:1px; }
.cmode-icon-reply{ background:#dbeafe; color:#1d4ed8; }
.cmode-icon-note{ background:#fef3c7; color:#b45309; }
.cmode-item-text{ flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.cmode-item-title{ font-size:13px; font-weight:600; color:#111827; line-height:1.25; }
.cmode-item-sub{ font-size:11.5px; color:#6b7280; line-height:1.35; }
.cmode-item-check{ display:none; align-items:center; justify-content:center; width:20px; height:20px; color:#2563eb; flex-shrink:0; margin-top:6px; }
.cmode-item[data-selected="true"] .cmode-item-check{ display:inline-flex; }
.cmode-item[data-selected="true"]{ background:#eff6ff; }
.cmode-item[data-selected="true"] .cmode-item-title{ color:#1d4ed8; }

/* reply-status dropdown (В ожидании / Закрыт) */
.reply-status-wrap{ position:relative; display:inline-block; }
.reply-status-btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 10px 7px 12px; min-height:38px;
  background:linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(248,250,252,.85) 100%);
  backdrop-filter:blur(10px) saturate(140%);
  -webkit-backdrop-filter:blur(10px) saturate(140%);
  border:1px solid rgba(203,213,225,.65);
  border-radius:8px; font-size:13px; font-weight:600; color:#111827; cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(15,23,42,.04), 0 2px 6px rgba(15,23,42,.04);
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.reply-status-btn:hover{
  border-color:rgba(99,102,241,.40);
  background:linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(238,242,255,.85) 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,1), 0 2px 4px rgba(15,23,42,.06), 0 4px 12px rgba(99,102,241,.10);
}
.reply-status-btn[aria-expanded="true"]{
  border-color:#6366f1;
  box-shadow:inset 0 1px 0 rgba(255,255,255,1), 0 0 0 3px rgba(99,102,241,.15);
}
.reply-status-btn .rstatus-icon{ display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:6px; flex-shrink:0; }
.reply-status-btn .rstatus-icon svg{ width:14px; height:14px; }
.reply-status-btn .rstatus-label{ white-space:nowrap; }
.reply-status-btn .rstatus-chevron{ color:#6b7280; transition:transform .15s; flex-shrink:0; }
.reply-status-btn[aria-expanded="true"] .rstatus-chevron{ transform:rotate(180deg); }
.reply-status-menu{
  position:absolute; bottom:calc(100% + 6px); left:0; min-width:280px;
  background:#fff; border:1px solid #e5e7eb; border-radius:10px;
  box-shadow:0 10px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  padding:6px; z-index:60; animation:cmodeFadeIn .12s ease-out;
}
.rstatus-item{
  display:flex; align-items:flex-start; gap:10px; width:100%;
  padding:10px; background:transparent; border:0; border-radius:8px;
  text-align:left; cursor:pointer; font-family:inherit; transition:background .1s;
}
.rstatus-item + .rstatus-item{ margin-top:2px; }
.rstatus-item:hover{ background:#f3f4f6; }
.rstatus-item-icon{ display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:8px; flex-shrink:0; margin-top:1px; }
.rstatus-icon-pending{ background:#fef3c7; color:#b45309; }
.rstatus-icon-closed{ background:#fee2e2; color:#b91c1c; }
.rstatus-item-text{ flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.rstatus-item-title{ font-size:13px; font-weight:600; color:#111827; line-height:1.25; }
.rstatus-item-sub{ font-size:11.5px; color:#6b7280; line-height:1.35; }
.rstatus-item-check{ display:none; align-items:center; justify-content:center; width:20px; height:20px; color:#4f46e5; flex-shrink:0; margin-top:6px; }
.rstatus-item[data-selected="true"] .rstatus-item-check{ display:inline-flex; }
.rstatus-item[data-selected="true"]{ background:#eef2ff; }
.rstatus-item[data-selected="true"] .rstatus-item-title{ color:#4338ca; }

#bulkReplyModal .ql-editor{
  padding:18px 20px;
  font-size:15px;
}

#bulkReplyModal .reply-section{
  background:#fff;
  border-radius:12px;
  padding:24px;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
}

#bulkReplyModal .reply-title{
  font-size:16px;
  font-weight:700;
  color:#111827;
  margin-bottom:0;
}

/* ── Кнопка ИИ в массовом ответе (1:1 с .ai-improve-btn в тикете) ── */
.ai-improve-wrap{ position:relative; display:inline-flex; }
.ai-improve-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:36px; height:36px; flex:none; padding:0; cursor:pointer;
  border:none; border-radius:10px;
  background:linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color:#fff;
  box-shadow:0 2px 6px rgba(99,102,241,.42), inset 0 1px 0 rgba(255,255,255,.3);
  transition:box-shadow .18s ease, transform .18s ease, filter .18s ease;
}
.ai-improve-btn svg{ width:19px; height:19px; }
.ai-improve-btn:hover{
  transform:translateY(-1px); filter:brightness(1.06);
  box-shadow:0 4px 12px rgba(99,102,241,.5), inset 0 1px 0 rgba(255,255,255,.3);
}
.ai-improve-btn:active{ transform:translateY(0); }
.ai-improve-btn[disabled]{ opacity:.6; cursor:not-allowed; transform:none; }
.ai-improve-btn.is-loading svg{ animation:aiwand-spin .8s linear infinite; }
@keyframes aiwand-spin{ to{ transform:rotate(360deg); } }
.ai-improve-tip{
  position:absolute;
  top:calc(100% + 6px);
  left:50%;
  transform:translateX(-50%) translateY(-4px);
  background:rgba(15,23,42,.92);
  color:#fff;
  font-size:11px;
  font-weight:400;
  padding:6px 10px;
  border-radius:6px;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease, transform .15s ease;
  z-index:50;
  line-height:1.4;
  letter-spacing:0;
  text-align:center;
  box-shadow:0 4px 12px rgba(15,23,42,.25);
}
.ai-improve-wrap:hover .ai-improve-tip{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
