/* ============================================================
 * lead-modal.css — ЕДИНЫЙ файл стилей карточки лида (LeadModal).
 * Консолидация 4 файлов (Step 1.3 дизайн-системы), порядок каскада
 * сохранён: polish -> redesign -> header-redesign -> tabs-polish.
 * Подключается из base.html ОДНОЙ ссылкой. Визуал идентичен прежнему.
 * ============================================================ */

/* ===== [lead-modal-polish.css] ===== */
/* Lead modal polish — лёгкая шлифовка под обе темы.
 * Файл специально не использует !important там где не нужно, чтобы
 * существующие inline-стили продолжали работать как fallback.
 *
 * Подключается из base.html после way-modal.css.
 */

/* === Контейнер информации лида === */
.lead-info-container {
    color: var(--color-text-primary, #e5e7eb);
}
.lead-info-container .lead-info-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

.lead-info-container h6,
.lead-info-container .section-title {
    color: var(--color-text-primary, #f8fafc);
}
.lead-info-container .table td:first-child {
    color: var(--color-text-secondary, #94a3b8);
}
.lead-info-container .table td:last-child {
    color: var(--color-text-primary, #f8fafc);
}

/* Кнопки быстрых действий и редактирования — гладкий focus state */
.lead-info-container button:focus-visible {
    outline: 2px solid #a78bfa;
    outline-offset: 2px;
}

/* Инвайт-инпут читаемее */
.lead-info-container input[id^="invite-link-input-"] {
    color: #f8fafc !important;
    background: rgba(0, 0, 0, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
}

/* === Светлая тема === */
html.theme-light .lead-info-container {
    color: #0f172a;
}
html.theme-light .lead-info-container .lead-info-section {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
html.theme-light .lead-info-container h6,
html.theme-light .lead-info-container .section-title {
    color: #0f172a;
}
html.theme-light .lead-info-container .table td {
    border-bottom-color: #e2e8f0;
}
html.theme-light .lead-info-container .table td:first-child {
    color: #64748b;
}
html.theme-light .lead-info-container .table td:last-child {
    color: #0f172a;
}
html.theme-light .lead-info-container .card {
    background: #f8fafc;
    border-color: #e2e8f0;
}
html.theme-light .lead-info-container .card-body {
    color: #1e293b;
}
html.theme-light .lead-info-container input[id^="invite-link-input-"] {
    color: #0f172a !important;
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}
html.theme-light .lead-info-container input[id^="invite-link-input-"]::placeholder {
    color: #94a3b8;
}

/* Кнопка "Пригласить заказчика" в светлой теме */
html.theme-light .lead-info-container .quick-action-btn {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5) !important;
    border: 1px solid #6ee7b7 !important;
    color: #047857 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15) !important;
}
html.theme-light .lead-info-container .quick-action-btn[disabled] {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
}

/* Кнопка "РЕДАКТИРОВАТЬ" — в светлой теме фон без тёмного контура */
html.theme-light .lead-info-container .edit-btn-main {
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.32) !important;
}

/* Раздел "Быстрые действия" / статусы */
.lead-info-container .quick-status-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.lead-info-container .quick-status-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    padding: 9px 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lead-info-container .quick-status-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(167, 139, 250, 0.5);
    color: #fff;
}
html.theme-light .lead-info-container .quick-status-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}
html.theme-light .lead-info-container .quick-status-btn:hover {
    background: #f1f5f9;
    border-color: #a78bfa;
    color: #6d28d9;
}

/* === Модалка создания лида: светлая тема === */
html.theme-light #createLeadModal .modal-content {
    background: #ffffff !important;
    color: #0f172a !important;
}
html.theme-light #createLeadModal .modal-body {
    background: #ffffff !important;
}
html.theme-light #createLeadModal .modal-header {
    border-bottom-color: #e2e8f0 !important;
}
html.theme-light #createLeadModal .modal-footer {
    background: #f8fafc !important;
    border-top-color: #e2e8f0 !important;
}
html.theme-light #createLeadModal .modal-title {
    color: #0f172a !important;
}
html.theme-light #createLeadModal .modern-form-label {
    color: #475569 !important;
}
html.theme-light #createLeadModal .modern-form-input,
html.theme-light #createLeadModal .modern-form-select,
html.theme-light #createLeadModal .form-control,
html.theme-light #createLeadModal .form-select {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
html.theme-light #createLeadModal .modern-form-input::placeholder,
html.theme-light #createLeadModal .form-control::placeholder {
    color: #94a3b8 !important;
}
html.theme-light #createLeadModal .modern-form-input:focus,
html.theme-light #createLeadModal .modern-form-select:focus {
    border-color: #a78bfa !important;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18) !important;
}
html.theme-light #createLeadModal .btn-close {
    filter: none !important;
}

/* Pipeline / leads list — карточки лидов (используется на /pipeline и /crm) */
.crm-lead-card,
.lead-row {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.crm-lead-card:hover,
.lead-row:hover {
    border-color: rgba(167, 139, 250, 0.4);
    transform: translateY(-1px);
}
html.theme-light .crm-lead-card,
html.theme-light .lead-row {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
html.theme-light .crm-lead-card:hover,
html.theme-light .lead-row:hover {
    border-color: #a78bfa;
}


/* ===== [lead-modal-redesign.css] ===== */
/* =========================================================
 * Lead Modal — чистый редизайн карточки лида.
 * Используем семантические CSS-классы (.lm-* и .crml-*),
 * полностью адаптировано под обе темы и мобилки.
 *
 * Подключается из base.html после lead-modal-polish.css.
 * Полностью совместимо со старой разметкой (lead-info-*),
 * новые блоки с .lm- работают параллельно.
 * ========================================================= */

/* === 1. Корневой контейнер карточки === */
.lm-card {
    --lm-bg: #0f172a;
    --lm-surface: rgba(255, 255, 255, 0.03);
    --lm-surface-2: rgba(255, 255, 255, 0.06);
    --lm-border: rgba(255, 255, 255, 0.08);
    --lm-border-strong: rgba(167, 139, 250, 0.35);
    --lm-text: #f8fafc;
    --lm-text-muted: #94a3b8;
    --lm-accent: #a78bfa;
    --lm-accent-2: #818cf8;
    --lm-success: #10b981;
    --lm-warn: #f59e0b;
    --lm-danger: #ef4444;
    --lm-info: #3b82f6;

    max-width: 920px;
    margin: 0 auto;
    color: var(--lm-text);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 4px;
}

html.theme-light .lm-card {
    --lm-bg: #ffffff;
    --lm-surface: #ffffff;
    --lm-surface-2: #f8fafc;
    --lm-border: #e2e8f0;
    --lm-border-strong: #c4b5fd;
    --lm-text: #0f172a;
    --lm-text-muted: #64748b;
    --lm-accent: #7c3aed;
    --lm-accent-2: #6366f1;
}

/* === 2. Шапка карточки: имя, статус, бюджет === */
.lm-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 20px 22px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.16), rgba(118, 75, 162, 0.16));
    border: 1px solid var(--lm-border-strong);
    border-radius: 18px;
}
html.theme-light .lm-hero {
    background: linear-gradient(135deg, #ede9fe, #f5f3ff);
    border-color: #c4b5fd;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.10);
}

.lm-hero__title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--lm-text);
    line-height: 1.25;
    word-break: break-word;
}
.lm-hero__sub {
    color: var(--lm-text-muted);
    font-size: 0.85rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lm-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(167, 139, 250, 0.18);
    color: var(--lm-accent);
    border: 1px solid var(--lm-border-strong);
}
html.theme-light .lm-hero__badge {
    background: #ede9fe;
    color: #6d28d9;
}
.lm-hero__budget {
    text-align: right;
    align-self: center;
}
.lm-hero__budget-value {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--lm-success);
    line-height: 1;
}
html.theme-light .lm-hero__budget-value { color: #047857; }
.lm-hero__budget-label {
    font-size: 0.7rem;
    color: var(--lm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 4px;
}

/* === 3. Секция (общий стиль для всех блоков) === */
.lm-section {
    background: var(--lm-surface);
    border: 1px solid var(--lm-border);
    border-radius: 16px;
    padding: 18px 20px;
}
html.theme-light .lm-section {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.lm-section__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.lm-section__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--lm-accent), var(--lm-accent-2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.lm-section__title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--lm-text-muted);
}
html.theme-light .lm-section__title { color: #475569; }
.lm-section__hint {
    margin-left: auto;
    font-size: 0.74rem;
    color: var(--lm-text-muted);
}

/* === 4. Список свойств: иконка + лейбл + значение === */
.lm-prop-list { display: flex; flex-direction: column; }
.lm-prop {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--lm-border);
}
.lm-prop:last-child { border-bottom: none; }
.lm-prop__icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #667eea, #764ba2);
    font-size: 1rem;
    flex-shrink: 0;
}
.lm-prop__icon--success { background: linear-gradient(135deg, #10b981, #059669); }
.lm-prop__icon--warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.lm-prop__icon--info { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.lm-prop__icon--pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.lm-prop__icon--cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.lm-prop__body { min-width: 0; }
.lm-prop__label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--lm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 3px;
}
html.theme-light .lm-prop__label { color: #64748b; }
.lm-prop__value {
    color: var(--lm-text);
    font-weight: 700;
    font-size: 0.95rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.lm-prop__value a {
    color: inherit;
    text-decoration: none;
}
.lm-prop__value a:hover { text-decoration: underline; }
.lm-prop__value--accent { color: var(--lm-success); font-weight: 800; }

.lm-prop__action {
    background: var(--lm-surface-2);
    border: 1px solid var(--lm-border);
    color: var(--lm-text-muted);
    padding: 6px 10px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}
.lm-prop__action:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    color: var(--lm-success);
}
html.theme-light .lm-prop__action {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}
html.theme-light .lm-prop__action:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}

/* === 5. Описание/заметки === */
.lm-note {
    padding: 14px 16px;
    background: var(--lm-surface-2);
    border-radius: 12px;
    border-left: 3px solid var(--lm-accent);
    color: var(--lm-text);
    font-size: 0.92rem;
    line-height: 1.6;
    white-space: pre-wrap;
}
html.theme-light .lm-note {
    background: #f8fafc;
    color: #1e293b;
}

/* === 6. Кнопки действий === */
.lm-actions {
    display: grid;
    gap: 10px;
}
.lm-actions--grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.lm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
    background: transparent;
    color: var(--lm-text);
    text-align: center;
    user-select: none;
}
.lm-btn:hover { transform: translateY(-1px); }
.lm-btn:active { transform: translateY(0); }
.lm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.lm-btn--ghost {
    background: var(--lm-surface-2);
    border-color: var(--lm-border);
    color: var(--lm-text);
}
.lm-btn--ghost:hover {
    border-color: var(--lm-border-strong);
    background: rgba(167, 139, 250, 0.10);
}
html.theme-light .lm-btn--ghost {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}
html.theme-light .lm-btn--ghost:hover {
    background: #f1f5f9;
    border-color: #a78bfa;
    color: #6d28d9;
}

.lm-btn--primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
}
.lm-btn--primary:hover {
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
}

.lm-btn--success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}
.lm-btn--success:hover {
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.45);
}

.lm-btn--danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ef4444;
}
.lm-btn--danger:hover {
    background: rgba(239, 68, 68, 0.25);
}
html.theme-light .lm-btn--danger {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.lm-btn--lg {
    padding: 16px 22px;
    font-size: 0.95rem;
    border-radius: 14px;
}

.lm-btn__icon { font-size: 1rem; }

/* === 7. Инвайт-блок (приглашение заказчика) === */
.lm-invite {
    border-radius: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.16), rgba(139, 92, 246, 0.08));
    border: 1px solid var(--lm-border-strong);
}
html.theme-light .lm-invite {
    background: linear-gradient(135deg, #ede9fe, #f5f3ff);
    border-color: #c4b5fd;
}

.lm-invite__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--lm-accent);
    margin-bottom: 6px;
}
.lm-invite__hint {
    font-size: 0.82rem;
    color: var(--lm-text-muted);
    line-height: 1.45;
    margin-bottom: 12px;
}
.lm-invite__btn {
    width: 100%;
}
.lm-invite__status {
    margin-top: 10px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}
html.theme-light .lm-invite__status {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}
.lm-invite__result {
    margin-top: 12px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    padding: 12px;
}
html.theme-light .lm-invite__result {
    background: #ecfdf5;
    border-color: #a7f3d0;
}
.lm-invite__result-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--lm-success);
    margin-bottom: 8px;
}
.lm-invite__row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}
.lm-invite__input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--lm-border);
    border-radius: 10px;
    color: var(--lm-text);
    font-size: 0.82rem;
    font-family: 'SF Mono', Consolas, monospace;
}
html.theme-light .lm-invite__input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}
.lm-invite__copy {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
html.theme-light .lm-invite__copy {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}
.lm-invite__copy:hover {
    background: rgba(16, 185, 129, 0.30);
}
html.theme-light .lm-invite__copy:hover {
    background: #a7f3d0;
}

/* === 8. Быстрые статусные кнопки === */
.lm-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.lm-quick-btn {
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid var(--lm-border);
    background: var(--lm-surface-2);
    color: var(--lm-text);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}
.lm-quick-btn:hover {
    border-color: var(--lm-accent);
    transform: translateY(-1px);
}
html.theme-light .lm-quick-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}
html.theme-light .lm-quick-btn:hover {
    background: #f8fafc;
    border-color: #a78bfa;
    color: #6d28d9;
}

.lm-quick-empty {
    padding: 12px 14px;
    border-radius: 11px;
    background: var(--lm-surface-2);
    border: 1px dashed var(--lm-border);
    color: var(--lm-text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* === 9. Сетка фактов проекта (тип / площадь / бюджет / сроки) === */
.lm-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}
.lm-fact {
    background: var(--lm-surface-2);
    border: 1px solid var(--lm-border);
    border-radius: 12px;
    padding: 12px 14px;
}
html.theme-light .lm-fact {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.lm-fact__label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--lm-text-muted);
    margin-bottom: 4px;
}
.lm-fact__value {
    font-weight: 800;
    color: var(--lm-text);
    font-size: 0.98rem;
}
.lm-fact__value--money { color: var(--lm-success); }
html.theme-light .lm-fact__value--money { color: #047857; }

/* === 10. Конструктор мечты === */
.lm-dream {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.14), rgba(219, 39, 119, 0.10));
    border: 1px solid rgba(236, 72, 153, 0.32);
    border-radius: 16px;
    padding: 18px 20px;
}
html.theme-light .lm-dream {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    border-color: #f9a8d4;
}
.lm-dream__title {
    color: #ec4899;
    display: flex;
    align-items: center;
    gap: 10px;
}
.lm-dream__title .lm-section__icon {
    background: linear-gradient(135deg, #ec4899, #db2777);
}
.lm-dream__hot {
    margin-left: auto;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 0.6rem;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.6px;
}
.lm-dream__panel {
    background: var(--lm-surface-2);
    border-radius: 11px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
html.theme-light .lm-dream__panel {
    background: #ffffff;
    border: 1px solid #fce7f3;
}
.lm-dream__panel-label {
    font-size: 0.68rem;
    color: #ec4899;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 700;
    margin-bottom: 6px;
}
.lm-dream__row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.86rem;
    color: var(--lm-text);
    border-bottom: 1px dashed var(--lm-border);
}
.lm-dream__row:last-child { border-bottom: none; }
.lm-dream__row-label { color: var(--lm-text-muted); }
.lm-dream__row-value { font-weight: 700; }
.lm-dream__total {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
}
html.theme-light .lm-dream__total {
    background: #ecfdf5;
    border-color: #6ee7b7;
}
.lm-dream__total-row {
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 8px;
    color: var(--lm-success);
    font-size: 1.1rem;
    font-weight: 900;
}
html.theme-light .lm-dream__total-row {
    border-top-color: #6ee7b7;
}

/* === 11. Финальный CTA-блок (создать объект, редактировать) === */
.lm-cta {
    display: grid;
    gap: 10px;
    padding-top: 6px;
}

/* === 12. Mobile === */
@media (max-width: 640px) {
    .lm-card { padding: 0 2px; gap: 14px; }
    .lm-section { padding: 14px 14px; }
    .lm-hero { grid-template-columns: 1fr; }
    .lm-hero__budget { text-align: left; }
    .lm-prop {
        grid-template-columns: 32px 1fr;
        grid-template-rows: auto auto;
    }
    .lm-prop__action { grid-column: 2; justify-self: end; }
    .lm-quick-actions { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}


/* === 13. Funnel timeline (воронка лида в карточке) === */
.lm-funnel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
.lm-funnel-step {
    position: relative;
    padding: 10px 12px;
    border-radius: 11px;
    background: var(--lm-surface-2);
    border: 1px solid var(--lm-border);
    color: var(--lm-text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 60px;
    transition: all 0.15s ease;
}
html.theme-light .lm-funnel-step {
    background: #f8fafc;
    border-color: #e2e8f0;
}
.lm-funnel-step__num {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--lm-text-muted);
}
.lm-funnel-step__label {
    font-weight: 700;
    font-size: 0.82rem;
    line-height: 1.2;
    color: var(--lm-text);
}
.lm-funnel-step--done {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.32);
    color: #6ee7b7;
}
html.theme-light .lm-funnel-step--done {
    background: #ecfdf5;
    border-color: #6ee7b7;
}
.lm-funnel-step--done .lm-funnel-step__label,
.lm-funnel-step--done .lm-funnel-step__num {
    color: #047857;
}
html.theme-light .lm-funnel-step--done .lm-funnel-step__label,
html.theme-light .lm-funnel-step--done .lm-funnel-step__num {
    color: #047857;
}
.lm-funnel-step--current {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.22), rgba(139, 92, 246, 0.18));
    border-color: var(--lm-border-strong);
    color: #fff;
    box-shadow: 0 6px 18px rgba(167, 139, 250, 0.25);
}
html.theme-light .lm-funnel-step--current {
    background: linear-gradient(135deg, #ede9fe, #f5f3ff);
    border-color: #a78bfa;
    color: #4c1d95;
}
.lm-funnel-step--current .lm-funnel-step__label,
.lm-funnel-step--current .lm-funnel-step__num {
    color: inherit;
}
.lm-funnel-step--lost {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}
html.theme-light .lm-funnel-step--lost {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.lm-funnel__divider {
    margin: 14px 0 8px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--lm-text-muted);
}

/* Контекстный блок «что сделать сейчас» */
.lm-context {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(251, 191, 36, 0.04));
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 14px;
    padding: 14px 16px;
}
html.theme-light .lm-context {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fcd34d;
}
.lm-context__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 0.86rem;
    color: #fbbf24;
    margin-bottom: 6px;
}
html.theme-light .lm-context__title { color: #b45309; }
.lm-context__hint {
    font-size: 0.83rem;
    line-height: 1.45;
    color: var(--lm-text);
    margin-bottom: 10px;
}
html.theme-light .lm-context__hint { color: #1e293b; }
.lm-context__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
}


/* ===== [lead-modal-header-redesign.css] ===== */
/* ==========================================================================
 * lead-modal-header-redesign.css
 * Чистый дизайн верха карточки лида (header + quick-actions + tabs).
 *
 * Подключается в base.html ПОСЛЕ way-modal.css и lead-modal-redesign.css,
 * чтобы переопределить тяжёлый «фиолетовый градиент»+большие кнопки.
 *
 * Скоупится на #lead-modal-* — другие модалки не трогаем.
 * ========================================================================== */

/* === Корневой контейнер модалки лида === */
[id^="lead-modal-"] .modal-content {
    background: #14161c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}
html.theme-light [id^="lead-modal-"] .modal-content {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

/* === Header === */
[id^="lead-modal-"] .modal-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 20px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    flex-wrap: nowrap;
}
[id^="lead-modal-"] .modal-header::after {
    display: none;
}
html.theme-light [id^="lead-modal-"] .modal-header {
    border-bottom-color: #e2e8f0;
    background: transparent !important;
}

/* Левая часть — иконка + имя + ID */
[id^="lead-modal-"] .modal-title-container {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
[id^="lead-modal-"] .modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.25;
    min-width: 0;
    flex: 1;
}
html.theme-light [id^="lead-modal-"] .modal-title {
    color: #0f172a;
}

[id^="lead-modal-"] .modal-title .entity-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}
html.theme-light [id^="lead-modal-"] .modal-title .entity-icon {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

[id^="lead-modal-"] .modal-title .title-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

[id^="lead-modal-"] .modal-title .entity-id {
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    opacity: 1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
html.theme-light [id^="lead-modal-"] .modal-title .entity-id {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

/* Status badge у заголовка скрываем — он есть в lm-hero */
[id^="lead-modal-"] .entity-status {
    display: none;
}

/* === Quick actions — компактные на десктопе, растянуты на мобилке === */
[id^="lead-modal-"] .quick-actions-header {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

[id^="lead-modal-"] .quick-actions-header .quick-action-btn {
    width: 38px;
    height: 38px;
    min-width: 0;
    padding: 0;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: none;
    overflow: visible;
}
[id^="lead-modal-"] .quick-actions-header .quick-action-btn::before {
    display: none;
}
[id^="lead-modal-"] .quick-actions-header .quick-action-btn span:last-child,
[id^="lead-modal-"] .quick-actions-header .quick-action-btn .action-label {
    display: none !important;
}
[id^="lead-modal-"] .quick-actions-header .quick-action-btn span:first-child {
    font-size: 1rem;
    line-height: 1;
}
[id^="lead-modal-"] .quick-actions-header .quick-action-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(167, 139, 250, 0.4);
    background: rgba(167, 139, 250, 0.10);
    color: #fff;
    box-shadow: 0 6px 18px rgba(167, 139, 250, 0.20);
}

/* Цвета по типу действия — тонкие, не кричащие */
[id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-success {
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.32);
    background: rgba(16, 185, 129, 0.10);
}
[id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-success:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.55);
    color: #10b981;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.22);
}

[id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-primary {
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.32);
    background: rgba(59, 130, 246, 0.10);
}
[id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-primary:hover {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.55);
    color: #60a5fa;
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.22);
}

[id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-info {
    color: #22d3ee;
    border-color: rgba(6, 182, 212, 0.32);
    background: rgba(6, 182, 212, 0.10);
}
[id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-info:hover {
    background: rgba(6, 182, 212, 0.18);
    border-color: rgba(6, 182, 212, 0.55);
    color: #22d3ee;
    box-shadow: 0 6px 18px rgba(6, 182, 212, 0.22);
}

[id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-warning {
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.10);
}

/* Light theme */
html.theme-light [id^="lead-modal-"] .quick-actions-header .quick-action-btn {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}
html.theme-light [id^="lead-modal-"] .quick-actions-header .quick-action-btn:hover {
    background: #f5f3ff;
    border-color: #a78bfa;
    color: #6d28d9;
}
html.theme-light [id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-success {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}
html.theme-light [id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-primary {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}
html.theme-light [id^="lead-modal-"] .quick-actions-header .quick-action-btn.btn-info {
    background: #cffafe;
    border-color: #67e8f9;
    color: #0e7490;
}

/* Кнопка закрытия — мягче и меньше */
[id^="lead-modal-"] .modal-header .btn-close {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.04);
    background-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    opacity: 0.85;
    margin: 0;
    flex-shrink: 0;
    transition: all 0.15s ease;
}
[id^="lead-modal-"] .modal-header .btn-close:hover {
    opacity: 1;
    transform: none;
    background-color: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.35);
}
html.theme-light [id^="lead-modal-"] .modal-header .btn-close {
    background-color: #f1f5f9;
    border-color: #e2e8f0;
    filter: none;
}
html.theme-light [id^="lead-modal-"] .modal-header .btn-close:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

/* === Tabs — equal width, clean look === */
[id^="lead-modal-"] .modal-tabs-nav {
    background: transparent;
    padding: 0 20px;
    display: block;
    border-bottom: none;
}
[id^="lead-modal-"] .modal-tabs-nav > nav {
    display: block;
    width: 100%;
}
html.theme-light [id^="lead-modal-"] .modal-tabs-nav {
    border-bottom-color: #e2e8f0;
}

[id^="lead-modal-"] .modal-tabs-nav .nav-tabs {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
    padding: 4px;
    gap: 4px;
    border-radius: 14px;
    width: 100%;
    display: flex !important;
    flex-wrap: nowrap;
}

[id^="lead-modal-"] .modal-tabs-nav .nav-link {
    flex: 1 1 0;
    height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    position: relative;
    transition: all 0.2s ease;
    white-space: nowrap;
}
[id^="lead-modal-"] .modal-tabs-nav .nav-link .way-modal-tab-text {
    display: inline;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}
[id^="lead-modal-"] .modal-tabs-nav .nav-link i {
    font-size: 1.05rem;
    color: inherit;
    transform: none !important;
    margin: 0;
}
[id^="lead-modal-"] .modal-tabs-nav .nav-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}
[id^="lead-modal-"] .modal-tabs-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.22), rgba(139, 92, 246, 0.18));
    border: 1px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}
[id^="lead-modal-"] .modal-tabs-nav .nav-link.active::after {
    display: none;
}
html.theme-light [id^="lead-modal-"] .modal-tabs-nav .nav-link {
    color: #64748b;
}
html.theme-light [id^="lead-modal-"] .modal-tabs-nav .nav-link:hover {
    background: #f1f5f9;
    color: #334155;
}
html.theme-light [id^="lead-modal-"] .modal-tabs-nav .nav-link.active {
    color: #4338ca;
    background: rgba(99, 102, 241, 0.10);
    border-color: rgba(99, 102, 241, 0.25);
}

/* Body — больше воздуха, меньше визуальных разрывов */
[id^="lead-modal-"] .modal-body {
    background: transparent;
    padding: 18px 20px 20px;
}
html.theme-light [id^="lead-modal-"] .modal-body {
    background: #ffffff;
}

/* Footer — вообще скрываем у LeadModal (для лида он не нужен — действия внутри) */
[id^="lead-modal-"] .modal-footer {
    display: none;
}

/* Mobile */
@media (max-width: 640px) {
    [id^="lead-modal-"] .modal-header {
        flex-wrap: wrap;
        padding: 12px 14px 12px;
        gap: 10px;
    }
    [id^="lead-modal-"] .modal-title {
        font-size: 0.95rem;
        gap: 8px;
    }
    [id^="lead-modal-"] .modal-title .entity-icon {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }
    [id^="lead-modal-"] .quick-actions-header {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    [id^="lead-modal-"] .quick-actions-header .quick-action-btn {
        width: 100%;
        height: 46px;
        border-radius: 12px;
    }
    [id^="lead-modal-"] .modal-tabs-nav {
        padding: 0 12px;
    }
    [id^="lead-modal-"] .modal-tabs-nav .nav-tabs {
        gap: 3px;
        padding: 3px;
        border-radius: 12px;
    }
    [id^="lead-modal-"] .modal-tabs-nav .nav-link {
        flex: 1 1 0;
        height: 40px;
        border-radius: 9px;
        gap: 6px;
        padding: 0 8px;
    }
    [id^="lead-modal-"] .modal-tabs-nav .nav-link .way-modal-tab-text {
        display: none;
    }
    [id^="lead-modal-"] .modal-body {
        padding: 14px 14px 16px;
    }
}

/* Iconic mode на узких экранах (планшетный portrait) */
@media (min-width: 641px) and (max-width: 880px) {
    [id^="lead-modal-"] .modal-tabs-nav .nav-link .way-modal-tab-text {
        display: none;
    }
    [id^="lead-modal-"] .modal-tabs-nav .nav-link {
        gap: 0;
    }
}


/* Hero внутри модалки лида — без дубля имени, компактнее */
[id^="lead-modal-"] .lm-hero {
    padding: 14px 16px;
    border-radius: 14px;
}
[id^="lead-modal-"] .lm-hero__sub {
    margin-top: 0;
    font-size: 0.82rem;
}
[id^="lead-modal-"] .lm-hero__budget-value {
    font-size: 1.25rem;
}


/* ===== [lead-modal-tabs-polish.css] ===== */
/* ==========================================================================
 * lead-modal-tabs-polish.css
 * Чистый премиум-дизайн вкладок «Задачи / Комментарии / История»
 * внутри карточки лида (LeadModal). Скоупится на [id^="lead-modal-"].
 *
 * Подключается в base.html ПОСЛЕ lead-modal-header-redesign.css.
 * Поддерживает обе темы и mobile.
 * ========================================================================== */

/* ============================================
   ОБЩИЕ ПЕРЕМЕННЫЕ + БАЗА
   ============================================ */
[id^="lead-modal-"] {
    --lmtp-bg: #14161c;
    --lmtp-surface: rgba(255, 255, 255, 0.03);
    --lmtp-surface-2: rgba(255, 255, 255, 0.06);
    --lmtp-surface-hover: rgba(255, 255, 255, 0.05);
    --lmtp-border: rgba(255, 255, 255, 0.08);
    --lmtp-border-strong: rgba(167, 139, 250, 0.35);
    --lmtp-text: #f8fafc;
    --lmtp-text-secondary: #cbd5e1;
    --lmtp-text-muted: #94a3b8;
    --lmtp-text-faint: #64748b;
    --lmtp-accent: #a78bfa;
    --lmtp-accent-2: #818cf8;
    --lmtp-success: #10b981;
    --lmtp-warn: #f59e0b;
    --lmtp-danger: #ef4444;
    --lmtp-info: #3b82f6;
}
html.theme-light [id^="lead-modal-"] {
    --lmtp-bg: #ffffff;
    --lmtp-surface: #ffffff;
    --lmtp-surface-2: #f8fafc;
    --lmtp-surface-hover: #f1f5f9;
    --lmtp-border: #e2e8f0;
    --lmtp-border-strong: #c4b5fd;
    --lmtp-text: #0f172a;
    --lmtp-text-secondary: #334155;
    --lmtp-text-muted: #64748b;
    --lmtp-text-faint: #94a3b8;
    --lmtp-accent: #7c3aed;
    --lmtp-accent-2: #6366f1;
}

/* ============================================
   #1 ВКЛАДКА «ЗАДАЧИ» (.lmt-*)
   ============================================ */

[id^="lead-modal-"] .lmt-wrap {
    max-width: 880px;
    margin: 0 auto;
    color: var(--lmtp-text);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Тулбар: заголовок + счётчик + кнопка «Новая» */
[id^="lead-modal-"] .lmt-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--lmtp-surface);
    border: 1px solid var(--lmtp-border);
    border-radius: 14px;
}
[id^="lead-modal-"] .lmt-toolbar-title {
    margin: 0;
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--lmtp-text);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
[id^="lead-modal-"] .lmt-toolbar-title i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
[id^="lead-modal-"] .lmt-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(167, 139, 250, 0.18);
    color: var(--lmtp-accent);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    border: 1px solid var(--lmtp-border-strong);
}
html.theme-light [id^="lead-modal-"] .lmt-count {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #c4b5fd;
}
[id^="lead-modal-"] .lmt-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 11px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 0.86rem;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.32);
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}
[id^="lead-modal-"] .lmt-btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.45);
}
[id^="lead-modal-"] .lmt-btn-add i { font-size: 0.95rem; }

/* Форма создания задачи */
[id^="lead-modal-"] .lmt-form-panel {
    display: grid !important;
    background: var(--lmtp-surface);
    border: 1px solid var(--lmtp-border-strong);
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.10);
    animation: lmtFormSlide 0.22s ease;
}
@keyframes lmtFormSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
[id^="lead-modal-"] .lmt-form-head {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--lmtp-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
[id^="lead-modal-"] .lmt-form-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
[id^="lead-modal-"] .lmt-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
[id^="lead-modal-"] .lmt-field-full {
    grid-column: 1 / -1;
}
[id^="lead-modal-"] .lmt-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--lmtp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
[id^="lead-modal-"] .lmt-input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 11px;
    border: 1px solid var(--lmtp-border);
    background: var(--lmtp-surface-2);
    color: var(--lmtp-text);
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
html.theme-light [id^="lead-modal-"] .lmt-input {
    background: #ffffff;
    border-color: #cbd5e1;
}
[id^="lead-modal-"] .lmt-input:focus {
    outline: none;
    border-color: var(--lmtp-accent);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
    background: var(--lmtp-bg);
}
html.theme-light [id^="lead-modal-"] .lmt-input:focus {
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
[id^="lead-modal-"] .lmt-textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}
[id^="lead-modal-"] .lmt-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 9 1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

[id^="lead-modal-"] .lmt-form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}
[id^="lead-modal-"] .lmt-btn-ghost,
[id^="lead-modal-"] .lmt-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 11px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
[id^="lead-modal-"] .lmt-btn-ghost {
    background: var(--lmtp-surface-2);
    border-color: var(--lmtp-border);
    color: var(--lmtp-text-secondary);
}
[id^="lead-modal-"] .lmt-btn-ghost:hover {
    background: var(--lmtp-surface-hover);
    color: var(--lmtp-text);
}
[id^="lead-modal-"] .lmt-btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}
[id^="lead-modal-"] .lmt-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(16, 185, 129, 0.4);
}

/* Список задач */
[id^="lead-modal-"] .lmt-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Empty state */
[id^="lead-modal-"] .lmt-list > .text-center {
    padding: 40px 20px !important;
    background: var(--lmtp-surface) !important;
    border: 1px dashed var(--lmtp-border) !important;
    border-radius: 14px !important;
    color: var(--lmtp-text-muted) !important;
}
[id^="lead-modal-"] .lmt-list > .text-center i {
    color: var(--lmtp-accent) !important;
    opacity: 0.3 !important;
    font-size: 2.6rem !important;
}
[id^="lead-modal-"] .lmt-list > .text-center p {
    color: var(--lmtp-text-muted) !important;
    margin-top: 12px !important;
    font-size: 0.92rem !important;
}
html.theme-light [id^="lead-modal-"] .lmt-list > .text-center {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* Карточка задачи */
[id^="lead-modal-"] .lmt-task-card {
    background: var(--lmtp-surface);
    border: 1px solid var(--lmtp-border);
    border-radius: 14px;
    padding: 14px 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    position: relative;
    overflow: hidden;
}
html.theme-light [id^="lead-modal-"] .lmt-task-card {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
[id^="lead-modal-"] .lmt-task-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 0 2px 2px 0;
}
[id^="lead-modal-"] .lmt-task-card:hover {
    border-color: var(--lmtp-border-strong);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(99, 102, 241, 0.15);
}
[id^="lead-modal-"] .lmt-task-card--overdue {
    border-color: rgba(239, 68, 68, 0.4);
}
[id^="lead-modal-"] .lmt-task-card--overdue::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}
html.theme-light [id^="lead-modal-"] .lmt-task-card--overdue {
    background: linear-gradient(145deg, #fff1f2 0%, #ffffff 60%);
}

[id^="lead-modal-"] .lmt-task-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
[id^="lead-modal-"] .lmt-task-title {
    margin: 0;
    flex: 1 1 200px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--lmtp-text);
    line-height: 1.4;
    word-break: break-word;
    min-width: 0;
}
[id^="lead-modal-"] .lmt-task-badges {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
[id^="lead-modal-"] .lmt-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    border: 1px solid;
    line-height: 1.6;
}

[id^="lead-modal-"] .lmt-task-desc {
    margin: 6px 0 8px;
    padding: 8px 12px;
    background: var(--lmtp-surface-2);
    border-left: 3px solid var(--lmtp-border-strong);
    border-radius: 8px;
    color: var(--lmtp-text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
}
html.theme-light [id^="lead-modal-"] .lmt-task-desc {
    background: #f8fafc;
    color: #334155;
}

[id^="lead-modal-"] .lmt-task-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--lmtp-border);
    flex-wrap: wrap;
}
[id^="lead-modal-"] .lmt-task-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--lmtp-text-muted);
    flex-wrap: wrap;
    flex: 1 1 0;
    min-width: 0;
}
[id^="lead-modal-"] .lmt-task-meta i { font-size: 0.85rem; color: var(--lmtp-accent); }
[id^="lead-modal-"] .lmt-task-meta--late { color: #fca5a5; }
[id^="lead-modal-"] .lmt-task-meta--late i { color: #ef4444; }
html.theme-light [id^="lead-modal-"] .lmt-task-meta--late { color: #b91c1c; }

[id^="lead-modal-"] .lmt-task-type {
    padding: 2px 9px;
    border-radius: 6px;
    background: var(--lmtp-surface-2);
    border: 1px solid var(--lmtp-border);
    font-size: 0.72rem;
    color: var(--lmtp-text-secondary);
    font-weight: 600;
}
html.theme-light [id^="lead-modal-"] .lmt-task-type {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #475569;
}

[id^="lead-modal-"] .lmt-btn-done {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 13px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
[id^="lead-modal-"] .lmt-btn-done:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.2);
}
html.theme-light [id^="lead-modal-"] .lmt-btn-done {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #047857;
}
html.theme-light [id^="lead-modal-"] .lmt-btn-done:hover {
    background: #a7f3d0;
}

/* ============================================
   #2 ВКЛАДКА «КОММЕНТАРИИ»
   ============================================ */

/* Контейнер комментариев */
[id^="lead-modal-"] [id^="lead-comments-container-"] {
    max-width: 880px !important;
    margin: 0 auto !important;
    color: var(--lmtp-text);
}

/* Форма ввода комментария */
[id^="lead-modal-"] .comment-form {
    background: var(--lmtp-surface);
    border: 1px solid var(--lmtp-border);
    border-radius: 16px;
    padding: 16px 18px 14px !important;
    margin-bottom: 18px !important;
}
html.theme-light [id^="lead-modal-"] .comment-form {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

[id^="lead-modal-"] .comment-form h6 {
    color: var(--lmtp-text) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 10px !important;
    display: flex;
    align-items: center;
    gap: 10px;
}
[id^="lead-modal-"] .comment-form h6 i {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

[id^="lead-modal-"] [id^="new-comment-text-"] {
    width: 100%;
    background: var(--lmtp-surface-2) !important;
    border: 1px solid var(--lmtp-border) !important;
    border-radius: 12px !important;
    color: var(--lmtp-text) !important;
    padding: 12px 14px !important;
    font-size: 0.92rem !important;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    font-family: inherit;
}
html.theme-light [id^="lead-modal-"] [id^="new-comment-text-"] {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}
[id^="lead-modal-"] [id^="new-comment-text-"]:focus {
    outline: none;
    border-color: var(--lmtp-accent) !important;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
    background: var(--lmtp-bg) !important;
}
html.theme-light [id^="lead-modal-"] [id^="new-comment-text-"]:focus {
    background: #ffffff !important;
}
[id^="lead-modal-"] [id^="new-comment-text-"]::placeholder {
    color: var(--lmtp-text-faint);
}

/* Photo attach panel */
[id^="lead-modal-"] [id^="comment-photo-section-"] {
    background: var(--lmtp-surface-2) !important;
    border: 1px dashed var(--lmtp-border) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    margin-top: 10px !important;
}
html.theme-light [id^="lead-modal-"] [id^="comment-photo-section-"] {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}
[id^="lead-modal-"] [id^="comment-photo-section-"] label {
    background: rgba(16, 185, 129, 0.15) !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    border-radius: 9px !important;
    color: #10b981 !important;
    padding: 7px 14px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    transition: all 0.15s ease;
}
[id^="lead-modal-"] [id^="comment-photo-section-"] label:hover {
    background: rgba(16, 185, 129, 0.22) !important;
    border-color: rgba(16, 185, 129, 0.55) !important;
}
html.theme-light [id^="lead-modal-"] [id^="comment-photo-section-"] label {
    background: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    color: #047857 !important;
}

[id^="lead-modal-"] [id^="comment-photo-name-"] {
    color: var(--lmtp-text-muted) !important;
}
[id^="lead-modal-"] [id^="comment-photo-img-"] {
    border: 1px solid var(--lmtp-border) !important;
    border-radius: 9px !important;
}
[id^="lead-modal-"] [id^="comment-photo-desc-"] {
    background: var(--lmtp-surface) !important;
    border: 1px solid var(--lmtp-border) !important;
    border-radius: 9px !important;
    color: var(--lmtp-text) !important;
    padding: 9px 12px !important;
    font-size: 0.85rem !important;
}
html.theme-light [id^="lead-modal-"] [id^="comment-photo-desc-"] {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

/* Submit button under form */
[id^="lead-modal-"] .comment-form button.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    border: none !important;
    color: #fff !important;
    padding: 10px 20px !important;
    border-radius: 11px !important;
    font-weight: 700 !important;
    font-size: 0.86rem !important;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}
[id^="lead-modal-"] .comment-form button.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.4) !important;
}
[id^="lead-modal-"] .comment-form small {
    color: var(--lmtp-text-muted) !important;
    font-size: 0.78rem !important;
}

/* Список комментариев */
[id^="lead-modal-"] [id^="comments-list-"] > div:first-child {
    border-bottom-color: var(--lmtp-border) !important;
    padding-bottom: 10px !important;
    margin-bottom: 12px !important;
}
[id^="lead-modal-"] [id^="comments-list-"] h6 {
    color: var(--lmtp-text) !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin: 0 !important;
}

/* Карточка комментария */
[id^="lead-modal-"] .comment-item {
    background: var(--lmtp-surface) !important;
    border: 1px solid var(--lmtp-border) !important;
    border-radius: 14px !important;
    padding: 14px 16px !important;
    margin-bottom: 10px !important;
    transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
[id^="lead-modal-"] .comment-item:hover {
    border-color: var(--lmtp-border-strong) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.10);
}
html.theme-light [id^="lead-modal-"] .comment-item {
    background: #ffffff !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

/* Заголовок комментария — автор + дата + удаление */
[id^="lead-modal-"] .comment-item > div:first-child > div:first-child > div:first-child {
    /* avatar */
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.30);
}
[id^="lead-modal-"] .comment-item > div:first-child > div:first-child > div:nth-child(2) > div:first-child {
    /* name */
    color: var(--lmtp-text) !important;
}
[id^="lead-modal-"] .comment-item > div:first-child > div:first-child > div:nth-child(2) > div:nth-child(2) {
    /* date */
    color: var(--lmtp-text-muted) !important;
    font-size: 0.78rem !important;
}

/* Тело комментария */
[id^="lead-modal-"] .comment-item > div:nth-child(2) {
    color: var(--lmtp-text-secondary) !important;
    font-size: 0.92rem !important;
    line-height: 1.6;
}
html.theme-light [id^="lead-modal-"] .comment-item > div:nth-child(2) {
    color: #1e293b !important;
}

/* Фото-блок внутри комментария */
[id^="lead-modal-"] .comment-item button[onclick*="showCommentPhoto"] {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.14)) !important;
    border: 1px solid rgba(16, 185, 129, 0.4) !important;
    color: #10b981 !important;
    padding: 8px 14px !important;
    border-radius: 10px !important;
    font-size: 0.82rem !important;
    transition: all 0.15s ease;
}
[id^="lead-modal-"] .comment-item button[onclick*="showCommentPhoto"]:hover {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: rgba(16, 185, 129, 0.6) !important;
}
html.theme-light [id^="lead-modal-"] .comment-item button[onclick*="showCommentPhoto"] {
    background: #d1fae5 !important;
    color: #047857 !important;
}

[id^="lead-modal-"] .comment-item button.btn-link.text-danger {
    background: transparent !important;
    border: 1px solid var(--lmtp-border) !important;
    border-radius: 8px !important;
    color: var(--lmtp-text-muted) !important;
    width: 28px;
    height: 28px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}
[id^="lead-modal-"] .comment-item button.btn-link.text-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
    color: #ef4444 !important;
}

/* Empty state для комментариев */
[id^="lead-modal-"] [id^="comments-list-"] > .text-center {
    padding: 40px 20px !important;
    background: var(--lmtp-surface) !important;
    border: 1px dashed var(--lmtp-border) !important;
    border-radius: 14px !important;
}
[id^="lead-modal-"] [id^="comments-list-"] > .text-center i {
    color: var(--lmtp-accent) !important;
    opacity: 0.3 !important;
    font-size: 2.6rem !important;
}
[id^="lead-modal-"] [id^="comments-list-"] > .text-center p {
    color: var(--lmtp-text-muted) !important;
    margin-top: 12px !important;
    font-size: 0.92rem !important;
}
html.theme-light [id^="lead-modal-"] [id^="comments-list-"] > .text-center {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* ============================================
   #3 ВКЛАДКА «ИСТОРИЯ»
   ============================================ */

[id^="lead-modal-"] .history-item {
    background: var(--lmtp-surface);
    border: 1px solid var(--lmtp-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px !important;
    transition: border-color 0.15s ease, transform 0.12s ease;
    position: relative;
    overflow: hidden;
}
[id^="lead-modal-"] .history-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 0 2px 2px 0;
    opacity: 0.5;
}
[id^="lead-modal-"] .history-item:hover {
    border-color: var(--lmtp-border-strong);
    transform: translateY(-1px);
}
html.theme-light [id^="lead-modal-"] .history-item {
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

[id^="lead-modal-"] .history-item .history-icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--lmtp-surface-2);
    border: 1px solid var(--lmtp-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
html.theme-light [id^="lead-modal-"] .history-item .history-icon {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

[id^="lead-modal-"] .history-item strong {
    color: var(--lmtp-text);
    font-weight: 700;
    font-size: 0.92rem;
}
[id^="lead-modal-"] .history-item .text-muted {
    color: var(--lmtp-text-muted) !important;
    font-size: 0.78rem;
}
[id^="lead-modal-"] .history-item p {
    color: var(--lmtp-text-secondary) !important;
    font-size: 0.86rem;
    line-height: 1.5;
    margin-top: 4px !important;
}

/* ============================================
   MOBILE ADAPTATION
   ============================================ */
@media (max-width: 640px) {
    [id^="lead-modal-"] .lmt-toolbar {
        padding: 12px 12px;
        flex-wrap: wrap;
    }
    [id^="lead-modal-"] .lmt-btn-add {
        padding: 9px 14px;
        font-size: 0.84rem;
    }
    [id^="lead-modal-"] .lmt-form-grid {
        grid-template-columns: 1fr;
    }
    [id^="lead-modal-"] .lmt-form-actions {
        flex-direction: column-reverse;
    }
    [id^="lead-modal-"] .lmt-form-actions .lmt-btn-ghost,
    [id^="lead-modal-"] .lmt-form-actions .lmt-btn-primary {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 0.92rem;
    }
    [id^="lead-modal-"] .lmt-task-card {
        padding: 12px 14px;
    }
    [id^="lead-modal-"] .lmt-task-head {
        flex-direction: column;
        gap: 8px;
    }
    [id^="lead-modal-"] .lmt-task-foot {
        flex-direction: column;
        align-items: stretch;
    }
    [id^="lead-modal-"] .lmt-btn-done {
        width: 100%;
        justify-content: center;
        padding: 10px;
        font-size: 0.86rem;
    }
    [id^="lead-modal-"] .comment-form {
        padding: 14px !important;
    }
    [id^="lead-modal-"] .comment-form > div:last-child {
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
    }
    [id^="lead-modal-"] .comment-form button.btn-primary {
        width: 100%;
        justify-content: center;
        padding: 12px !important;
    }
    [id^="lead-modal-"] [id^="comment-photo-section-"] > div:first-child {
        flex-direction: column;
        align-items: stretch !important;
    }
    [id^="lead-modal-"] [id^="comment-photo-section-"] label {
        width: 100%;
        justify-content: center;
    }
    [id^="lead-modal-"] .comment-item {
        padding: 12px !important;
    }
    [id^="lead-modal-"] .history-item {
        padding: 10px 12px;
    }
}

/* ============================================================
 * PREMIUM 2026 — финальный слой полировки карточки лида.
 * ТОЛЬКО косметика (тени, градиенты, hover, мягкий вход);
 * логика и разметка не трогаются. Идёт последним в каскаде,
 * поэтому аккуратно «поднимает» вид, ничего не ломая.
 * Обе темы + reduced-motion. Скоуп: [id^="lead-modal-"] и .lm-*.
 * ============================================================ */

/* — Оболочка окна: глубже и дороже — */
[id^="lead-modal-"] .modal-content {
    background: linear-gradient(180deg, #171a23 0%, #101218 100%);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 40px 120px -24px rgba(0, 0, 0, 0.72),
        0 12px 40px -12px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
html.theme-light [id^="lead-modal-"] .modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #fbfaff 100%);
    box-shadow:
        0 40px 100px -28px rgba(79, 70, 229, 0.22),
        0 12px 36px -14px rgba(15, 23, 42, 0.16);
}

/* — Мягкое появление тела карточки — */
@keyframes lmCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lm-card { animation: lmCardIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* — Иконка сущности в шапке — */
[id^="lead-modal-"] .modal-title .entity-icon {
    box-shadow: 0 6px 18px -4px rgba(102, 126, 234, 0.55);
}

/* — Быстрые действия в шапке (звонок/чат/задача): hover-подъём + свечение — */
[id^="lead-modal-"] .quick-actions-header .quick-action-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 139, 250, 0.45);
    color: #fff;
    box-shadow: 0 8px 20px -6px rgba(124, 58, 237, 0.45);
}

/* — Вкладки: премиальная активная — */
[id^="lead-modal-"] .modal-tabs-nav .nav-link {
    transition: color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}
[id^="lead-modal-"] .modal-tabs-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.30), rgba(99, 102, 241, 0.22));
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 8px 22px -8px rgba(124, 58, 237, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
[id^="lead-modal-"] .modal-tabs-nav .nav-link:hover:not(.active) { transform: translateY(-1px); }
html.theme-light [id^="lead-modal-"] .modal-tabs-nav .nav-link.active {
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    border-color: #c7d2fe;
    box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.35);
}

/* — Hero: слой глубины + верхний блик + мягкое свечение — */
.lm-hero {
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px -18px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.lm-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 140% at 0% 0%, rgba(167, 139, 250, 0.18), transparent 55%);
    pointer-events: none;
}
.lm-hero > * { position: relative; z-index: 1; }
html.theme-light .lm-hero {
    box-shadow: 0 12px 30px -16px rgba(124, 58, 237, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* — Секции: hover-подъём + свечение рамки — */
.lm-section {
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.lm-section:hover {
    transform: translateY(-2px);
    border-color: var(--lm-border-strong);
    box-shadow: 0 14px 34px -16px rgba(124, 58, 237, 0.40);
}
html.theme-light .lm-section:hover {
    box-shadow: 0 14px 30px -16px rgba(124, 58, 237, 0.20);
}

/* — Иконки секций и свойств: цветное свечение — */
.lm-section__icon { box-shadow: 0 6px 16px -5px rgba(124, 58, 237, 0.55); }
.lm-prop__icon { box-shadow: 0 6px 16px -6px rgba(102, 126, 234, 0.50); }
.lm-prop__icon--success { box-shadow: 0 6px 16px -6px rgba(16, 185, 129, 0.50); }
.lm-prop__icon--warn { box-shadow: 0 6px 16px -6px rgba(245, 158, 11, 0.50); }
.lm-prop__icon--info { box-shadow: 0 6px 16px -6px rgba(59, 130, 246, 0.50); }
.lm-prop__icon--pink { box-shadow: 0 6px 16px -6px rgba(236, 72, 153, 0.50); }
.lm-prop__icon--cyan { box-shadow: 0 6px 16px -6px rgba(6, 182, 212, 0.50); }

/* — Кнопки: премиальные тени + верхний блик — */
.lm-btn--primary {
    box-shadow: 0 10px 24px -8px rgba(102, 126, 234, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.lm-btn--primary:hover { box-shadow: 0 16px 34px -10px rgba(102, 126, 234, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.lm-btn--success {
    box-shadow: 0 10px 24px -8px rgba(16, 185, 129, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.lm-btn--success:hover { box-shadow: 0 16px 32px -10px rgba(16, 185, 129, 0.60), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.lm-btn--ghost:hover { box-shadow: 0 8px 20px -8px rgba(124, 58, 237, 0.30); }

/* — Инвайт-блок: премиальная подача — */
.lm-invite {
    box-shadow: 0 14px 34px -18px rgba(124, 58, 237, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
html.theme-light .lm-invite {
    box-shadow: 0 12px 28px -16px rgba(124, 58, 237, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* — Скроллбар тела окна — */
[id^="lead-modal-"] .modal-body { scrollbar-width: thin; scrollbar-color: rgba(167, 139, 250, 0.4) transparent; }
[id^="lead-modal-"] .modal-body::-webkit-scrollbar { width: 9px; }
[id^="lead-modal-"] .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.5), rgba(99, 102, 241, 0.4));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
[id^="lead-modal-"] .modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.7), rgba(99, 102, 241, 0.6));
    background-clip: padding-box;
}

/* — Уважаем reduced-motion — */
@media (prefers-reduced-motion: reduce) {
    .lm-card { animation: none; }
    .lm-section, .lm-btn, [id^="lead-modal-"] .modal-tabs-nav .nav-link,
    [id^="lead-modal-"] .quick-actions-header .quick-action-btn {
        transition: none !important;
    }
    .lm-section:hover, .lm-btn:hover { transform: none; }
}

/* ============================================================
 * BLACK-ORANGE 2026 — фирменная чёрно-оранжевая тема окна лида.
 * Перекрывает фиолетово-бирюзовые «премиум»-градиенты (они заданы
 * в других файлах со скоупом [id^="lead-modal-"]), поэтому здесь тоже
 * скоуп на окно + !important на фонах — иначе не победить. Только тёмная
 * тема (окно всегда тёмное). Верифицировано вживую.
 * ============================================================ */
[id^="lead-modal-"] .lm-card {
    --lm-accent: #fb923c;
    --lm-accent-2: #f97316;
    --lm-border-strong: rgba(249, 115, 22, 0.42);
    --lm-success: #34d399;
}
[id^="lead-modal-"] .modal-content {
    background: linear-gradient(180deg, #14110c 0%, #0b0a07 100%) !important;
    border-color: rgba(249, 115, 22, 0.16) !important;
}
[id^="lead-modal-"] .modal-header { border-bottom-color: rgba(249, 115, 22, 0.14) !important; }
[id^="lead-modal-"] .modal-title .entity-icon {
    background: linear-gradient(135deg, #fb923c, #ea580c) !important;
    box-shadow: 0 6px 18px -4px rgba(249, 115, 22, 0.6);
}
[id^="lead-modal-"] .modal-title .entity-id {
    border-color: rgba(249, 115, 22, 0.30) !important;
    color: #fdba74 !important;
    background: rgba(249, 115, 22, 0.08) !important;
}
[id^="lead-modal-"] .modal-tabs-nav .nav-tabs .nav-link.active,
[id^="lead-modal-"] .modal-tabs-nav .nav-link.active {
    color: #fff !important;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.32), rgba(251, 146, 60, 0.16)) !important;
    border: 1px solid rgba(249, 115, 22, 0.55) !important;
    box-shadow: 0 8px 22px -8px rgba(249, 115, 22, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}
[id^="lead-modal-"] .modal-tabs-nav .nav-link:hover:not(.active) { color: #fdba74 !important; }
[id^="lead-modal-"] .quick-actions-header .quick-action-btn:hover {
    border-color: rgba(249, 115, 22, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px -6px rgba(249, 115, 22, 0.45) !important;
}
[id^="lead-modal-"] .lm-hero {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(234, 88, 12, 0.08)) !important;
    border-color: rgba(249, 115, 22, 0.38) !important;
    box-shadow: 0 16px 40px -18px rgba(249, 115, 22, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
}
[id^="lead-modal-"] .lm-hero::before {
    background: radial-gradient(120% 140% at 0% 0%, rgba(251, 146, 60, 0.22), transparent 55%) !important;
}
[id^="lead-modal-"] .lm-hero__badge {
    background: rgba(249, 115, 22, 0.20) !important;
    color: #fdba74 !important;
    border-color: rgba(249, 115, 22, 0.42) !important;
}
[id^="lead-modal-"] .lm-hero__budget-value {
    background: linear-gradient(135deg, #fde68a, #fbbf24) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: #fbbf24 !important;
}
[id^="lead-modal-"] .lm-section__icon {
    background: linear-gradient(135deg, #fb923c, #ea580c) !important;
    box-shadow: 0 6px 16px -5px rgba(249, 115, 22, 0.55) !important;
}
[id^="lead-modal-"] .lm-prop__icon:not([class*="--"]) {
    background: linear-gradient(135deg, #fb923c, #ea580c) !important;
    box-shadow: 0 6px 16px -6px rgba(249, 115, 22, 0.5);
}
[id^="lead-modal-"] .lm-note { border-left-color: #f97316 !important; }
[id^="lead-modal-"] .lm-btn--primary {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%) !important;
    box-shadow: 0 10px 24px -8px rgba(249, 115, 22, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}
[id^="lead-modal-"] .lm-btn--success { background: linear-gradient(135deg, #34d399, #059669) !important; }
[id^="lead-modal-"] .lm-btn--ghost:hover {
    border-color: rgba(249, 115, 22, 0.5) !important;
    background: rgba(249, 115, 22, 0.10) !important;
    color: #fdba74 !important;
}
[id^="lead-modal-"] .lm-invite {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.16), rgba(234, 88, 12, 0.10)) !important;
    border-color: rgba(249, 115, 22, 0.32) !important;
    box-shadow: 0 14px 34px -18px rgba(249, 115, 22, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[id^="lead-modal-"] .lm-invite__title { color: #fdba74 !important; }
[id^="lead-modal-"] .lm-invite__btn { background: linear-gradient(135deg, #fb923c, #ea580c) !important; }
[id^="lead-modal-"] .modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.55), rgba(234, 88, 12, 0.45));
    background-clip: padding-box;
}



