/* ============================================================
   CRM — стили модулей CRM
   ============================================================ */

/* Переключатель Kanban / Список */
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-switch button { padding: 7px 14px; border: none; background: var(--surface); font-weight: 600; color: var(--text2); }
.view-switch button.active { background: var(--accent); color: #fff; }

/* Колонка воронки: заголовок с суммой ретейнеров */
.crm-col-head { display: flex; flex-direction: column; gap: 2px; width: 100%; }
.crm-col-head .crm-col-name { display: flex; justify-content: space-between; font-weight: 700; }
.crm-col-head .crm-col-sum { font-size: 11px; color: var(--text2); text-transform: none; font-weight: 600; }

/* Карточка лида */
.kanban-card-title { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.kanban-card-sub { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.kanban-card-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.kanban-card-meta { font-size: 11.5px; color: var(--text2); display: flex; justify-content: space-between; align-items: center; }
.kanban-card-meta .retainer { font-weight: 700; color: var(--text); }
.kanban-card-overdue { border-color: var(--red); }
.kanban-card-overdue .next-contact { color: var(--red); font-weight: 700; }
.kanban-ghost { opacity: .4; }
.kanban-add {
  width: 100%; padding: 8px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text2); font-weight: 600; margin-top: 4px;
}
.kanban-add:hover { border-color: var(--accent); color: var(--accent); }
.kanban-list { min-height: 20px; }

/* Карточка клиента (детальная страница) */
.client-detail { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .client-detail { grid-template-columns: 1fr; } }

.client-avatar {
  width: 60px; height: 60px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; margin-bottom: 12px;
}
.client-name-inline { font-size: 20px; font-weight: 800; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 2px 4px; }
.client-name-inline:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.client-field { margin-bottom: 12px; }
.client-field label { display: block; font-size: 11.5px; font-weight: 600; color: var(--text2); margin-bottom: 4px; }
.client-field .val { font-size: 13.5px; }

/* Timeline событий */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item .tl-dot {
  position: absolute; left: -26px; top: 0; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.timeline-item .tl-date { font-size: 11.5px; color: var(--text2); }
.timeline-item .tl-title { font-size: 13.5px; font-weight: 600; margin: 2px 0; }
.timeline-item .tl-next { font-size: 12px; color: var(--blue); }

/* Воронка (горизонтальные бары) на CRM-дашборде */
.funnel-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.funnel-bar .funnel-label { width: 130px; font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
.funnel-bar .funnel-track { flex: 1; background: var(--surface2); border-radius: 999px; height: 26px; overflow: hidden; }
.funnel-bar .funnel-fill { height: 100%; background: var(--accent); display: flex; align-items: center; padding: 0 10px; color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; white-space: nowrap; }
.funnel-bar .funnel-val { width: 90px; text-align: right; font-size: 12.5px; color: var(--text2); }

.crm-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.crm-tabs .tab { padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: var(--text2); border: none; background: none; border-bottom: 2px solid transparent; cursor: pointer; }
.crm-tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
