/* Возвращение клиентов (ТЗ 01.10.2026): раздел рабочего места в стиле реестра. */
#winback-view {
  padding: 8px;
  min-width: 0;
}
.winback-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 6px 8px;
  background: #eaf0f8;
  border: 1px solid #b6c7dd;
}
.winback-top h2 {
  margin: 0;
  font-size: 15px;
}
.winback-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 0;
}
.winback-filters button.active {
  background: var(--green);
  color: #fff;
}
.winback-search {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.winback-search input {
  flex: 1;
  max-width: 360px;
}
.winback-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 10px;
  align-items: start;
}
.winback-list {
  overflow-x: auto;
  min-width: 0;
}
.winback-list table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.winback-list th,
.winback-list td {
  border-bottom: 1px solid var(--line);
  padding: 5px 6px;
  text-align: left;
  vertical-align: top;
}
.winback-list td small {
  display: block;
  color: var(--muted);
}
.winback-list tr[data-id] {
  cursor: pointer;
}
.winback-list tr.active,
.winback-list tr[data-id]:hover {
  background: #eaf0f8;
}
.winback-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 10px;
  position: sticky;
  top: 8px;
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.winback-card h3 {
  margin: 0 0 4px;
}
.winback-actions {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.winback-script {
  white-space: pre-wrap;
  line-height: 1.45;
}
.winback-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
  margin-bottom: 6px;
}
.winback-result label,
.winback-form label {
  display: block;
  margin: 4px 0;
}
.winback-result textarea,
.winback-form textarea,
.winback-form input:not([type='checkbox']),
.winback-result input[type='datetime-local'] {
  width: 100%;
}
.winback-history,
.winback-orders {
  padding-left: 16px;
  margin: 4px 0;
}
.winback-orders small {
  display: block;
  color: var(--muted);
}
.winback-admin {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
}
.winback-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 6px 12px;
  align-items: end;
  margin: 8px 0;
}
.winback-form .wide {
  grid-column: 1 / -1;
}
@media (max-width: 900px) {
  .winback-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .winback-card {
    position: static;
    max-height: none;
  }
}
.winback-results label {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 0;
  padding: 2px 0;
}
.winback-results input {
  width: auto;
  margin: 0;
}
.winback-form [data-import-status] {
  grid-column: 1 / -1;
  margin: 0;
}
/* ТЗ v3: работа в строке клиента — звонок, результат, причина, «Сохранить». */
.winback-rows {
  display: grid;
  gap: 4px;
}
.winback-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) auto minmax(0, 3fr) minmax(120px, 1fr);
  gap: 8px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 8px;
}
.winback-row.active {
  border-color: var(--green);
  background: #f4f8fc;
}
.winback-who small {
  display: block;
  color: var(--muted);
}
.winback-who .link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--green);
  text-decoration: underline;
  cursor: pointer;
}
.winback-outcome {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
}
.winback-outcome input[name='comment'],
.winback-outcome input[name='correctionReason'] {
  flex: 1 1 160px;
}
.winback-hint {
  flex-basis: 100%;
  font-size: 11px;
  color: #855820;
}
.winback-hint:empty {
  display: none;
}
.winback-claim {
  font-size: 12px;
}
.winback-sms {
  font-size: 12px;
  color: var(--muted);
}
.winback-callback {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  padding: 6px;
  background: #f6f6f6;
}
@media (max-width: 900px) {
  .winback-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .winback-outcome,
  .winback-sms {
    grid-column: 1 / -1;
  }
}

.winback-report {
  border-collapse: collapse;
  margin: 6px 0;
}
.winback-report td {
  border-bottom: 1px solid var(--line);
  padding: 4px 10px 4px 0;
  vertical-align: top;
}

/* Задачи КЦ (05.10.2026): список дел на день */
#tasks-view { padding: 14px 18px; overflow: auto; }
.tasks-top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.tasks-top h2 { margin: 0; font-size: 20px; }
.tasks-summary { color: #475569; }
.tasks-top [data-refresh] { margin-left: auto; }
.task-campaign { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 10px;
  border-radius: 10px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.tasks-list { list-style: none; margin: 0; padding: 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff;
  overflow: hidden; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-top: 1px solid #eef2f6; }
.task-row:first-child { border-top: 0; }
.task-mark { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid #94a3b8; }
.task-taken .task-mark { border-color: #2563eb; background: radial-gradient(circle, #2563eb 0 4px, transparent 5px); }
.task-done .task-mark { border-color: #16a34a; background: #16a34a; position: relative; }
.task-done .task-mark::after { content: '✓'; position: absolute; inset: 0; color: #fff; font-size: 12px;
  line-height: 14px; text-align: center; }
.task-closed .task-mark { border-color: #cbd5e1; background: #e2e8f0; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 14px; color: #0f172a; }
.task-done .task-title, .task-closed .task-title { color: #64748b; font-weight: 500; }
.task-details { margin-top: 3px; color: #334155; white-space: pre-line; }
.task-who { margin-top: 4px; font-size: 13px; color: #1d4ed8; }
.task-done .task-who { color: #15803d; }
.task-meta { margin-top: 2px; font-size: 12px; color: #94a3b8; }
.task-tag { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 8px; background: #fee2e2; color: #b91c1c;
  font-size: 11px; font-weight: 600; vertical-align: 1px; }
.task-tag.warn { background: #fef3c7; color: #b45309; }
.task-overdue { background: #fffbeb; }
.task-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.task-actions button { white-space: nowrap; }
.task-actions .task-note { flex: 1 1 180px; min-width: 140px; max-width: 260px; }
.task-actions .task-done { background: #16a34a; border-color: #16a34a; color: #fff; }
.tasks-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #dc2626; color: #fff;
  font-size: 12px; font-weight: 700; text-align: center; }

.task-tag.ok { background: #dcfce7; color: #15803d; }
.call-winback { margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: #ecfdf5; color: #14532d; }

/* Новая задача (11.10.2026): карточка в правом нижнем углу и пульс кнопки «Задачи». */
.task-toast { position: fixed; right: 18px; bottom: 18px; z-index: 9000; width: 320px; padding: 14px 16px;
  background: #fffbeb; border: 2px solid #f59e0b; border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
  animation: task-toast-in .25s ease-out; }
.task-toast strong { display: block; font-size: 16px; margin-bottom: 6px; color: #92400e; }
.task-toast p { margin: 0 0 4px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-toast-actions { display: flex; gap: 8px; margin-top: 10px; }
@keyframes task-toast-in { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
/* Счётчик задач у свёрнутой панели навигации (18.10.2026): под стрелкой «⟩», при развёрнутой — на кнопке «Задачи». */
.rail-tasks-badge { display: none; }
body.navigation-collapsed .rail-tasks-badge:not([hidden]) { display: block; margin-top: 6px; min-width: 26px; padding: 2px 4px;
  border: 0; border-radius: 10px; background: #dc2626; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
body.navigation-collapsed .navigation-title { flex-direction: column; align-items: center; }
.rail-tasks-badge.tasks-new { animation: rail-badge-pulse 1.2s ease-in-out infinite; }
@keyframes rail-badge-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
#nav-tasks.tasks-new { animation: tasks-pulse 1.2s ease-in-out infinite; }
@keyframes tasks-pulse { 0%, 100% { background: transparent; } 50% { background: #fde68a; } }

/* Журнал звонков (28.10.2026): звонки за день, записи и пропущенные — вместо кабинета UIS в браузере. */
#call-journal-view { padding: 14px 18px; overflow: auto; }
.journal-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.journal-filters input[type='date'] { width: auto; }
.journal-filters input[type='search'] { flex: 0 1 180px; min-width: 140px; margin-left: auto; }
.journal-kind { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
.journal-kind.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.journal-player { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px;
  border-radius: 10px; background: #eff6ff; border: 1px solid #bfdbfe; }
.journal-player audio { flex: 1 1 320px; min-width: 240px; }
.journal-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.journal-table th { text-align: left; font-size: 12px; font-weight: 600; color: #64748b; padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0; }
.journal-table td { padding: 7px 10px; border-top: 1px solid #eef2f6; vertical-align: middle; white-space: nowrap; }
.journal-status { font-weight: 600; color: #15803d; }
.journal-missed { background: #fef2f2; }
.journal-missed .journal-status { color: #b91c1c; }
.journal-noanswer .journal-status { color: #b45309; }
.journal-actions { display: flex; gap: 6px; justify-content: flex-end; }
.journal-actions button { white-space: nowrap; }
