/* =========================================================
   Раздел "Назначенные сделки"
   ========================================================= */

.assigned-sales-section {
    border-color: #bbf7d0 !important;
    box-shadow: 0 5px 18px rgba(22, 163, 74, .06) !important;
}

.assigned-sales-section .card-title h2 {
    color: #166534 !important;
}

.assigned-sales-section table {
    min-width: 980px !important;
    table-layout: fixed !important;
}

.assigned-sales-section th,
.assigned-sales-section td {
    padding: 9px 8px !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    vertical-align: middle !important;
}

.assigned-sales-section th {
    font-size: 12px !important;
    font-weight: 900 !important;
    background: #f0fdf4 !important;
    color: #166534 !important;
}

.assigned-sales-section th:nth-child(1),
.assigned-sales-section td:nth-child(1) {
    width: 230px !important;
}

.assigned-sales-section th:nth-child(2),
.assigned-sales-section td:nth-child(2) {
    width: 120px !important;
    white-space: nowrap !important;
}

.assigned-sales-section th:nth-child(3),
.assigned-sales-section td:nth-child(3) {
    width: 150px !important;
}

.assigned-sales-section th:nth-child(4),
.assigned-sales-section td:nth-child(4) {
    width: 120px !important;
    white-space: nowrap !important;
}

.assigned-sales-section th:nth-child(5),
.assigned-sales-section td:nth-child(5) {
    width: 80px !important;
    text-align: center !important;
}

.assigned-sales-section th:nth-child(6),
.assigned-sales-section td:nth-child(6) {
    width: 110px !important;
    text-align: center !important;
}

.assigned-sales-section th:nth-child(7),
.assigned-sales-section td:nth-child(7) {
    width: 170px !important;
    text-align: center !important;
}

.assigned-sale-row {
    background: #f0fdf4 !important;
}

.assigned-sale-row:nth-child(even) {
    background: #ffffff !important;
}

.assigned-sales-section .client-name-cell {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.assigned-comments-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    width: auto !important;
    min-width: 46px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    border: 1px solid #bfdbfe !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    font-size: 15px !important;
    font-weight: 900 !important;
}

.assigned-comments-btn span {
    font-size: 12px !important;
}

.assigned-no-comments {
    color: #94a3b8 !important;
    font-weight: 900 !important;
}

.assigned-sale-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    align-items: stretch !important;
}

.assigned-sale-actions button {
    width: 100% !important;
    min-height: 32px !important;
    padding: 6px 9px !important;
    border-radius: 10px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
}

.assigned-today-btn {
    background: #16a34a !important;
    color: #ffffff !important;
}

.assigned-date-btn {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #bfdbfe !important;
}

.assigned-comments-modal {
    width: 620px !important;
    max-width: 94vw !important;
}

.assigned-comments-list {
    display: grid !important;
    gap: 10px !important;
    max-height: 62vh !important;
    overflow-y: auto !important;
    padding-right: 4px !important;
}

.assigned-comment-item {
    padding: 12px 14px !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    border: 1px solid #e5e7eb !important;
    border-left: 5px solid #2563eb !important;
}

.assigned-comment-item em {
    display: block !important;
    margin-bottom: 6px !important;
    color: #64748b !important;
    font-size: 12px !important;
    font-style: italic !important;
    font-weight: 800 !important;
}

.assigned-comment-item div {
    color: #111827 !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    font-style: normal !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
}

.assigned-comments-empty {
    padding: 16px !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
    color: #64748b !important;
    text-align: center !important;
    font-weight: 900 !important;
}

@media (max-width: 950px) {
    .assigned-sales-section .table-wrap {
        overflow: visible !important;
        border: none !important;
        background: transparent !important;
    }

    .assigned-sales-section table,
    .assigned-sales-section thead,
    .assigned-sales-section tbody,
    .assigned-sales-section tr,
    .assigned-sales-section td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .assigned-sales-section thead {
        display: none !important;
    }

    .assigned-sales-section tbody {
        display: grid !important;
        gap: 10px !important;
    }

    .assigned-sales-section tr {
        padding: 12px !important;
        border-radius: 16px !important;
        border: 1px solid #bbf7d0 !important;
        background: #ffffff !important;
        box-shadow: 0 3px 12px rgba(15,23,42,.05) !important;
    }

    .assigned-sales-section td {
        display: grid !important;
        grid-template-columns: 96px 1fr !important;
        gap: 8px !important;
        align-items: center !important;
        padding: 8px 0 !important;
        border: none !important;
        background: transparent !important;
        font-size: 14px !important;
    }

    .assigned-sales-section td::before {
        content: attr(data-label) !important;
        color: #64748b !important;
        font-size: 12px !important;
        font-weight: 900 !important;
    }

    .assigned-sales-section td[data-label="Клиент"] {
        display: block !important;
        padding-bottom: 10px !important;
        border-bottom: 1px solid #eef2f7 !important;
    }

    .assigned-sales-section td[data-label="Клиент"]::before {
        display: none !important;
    }

    .assigned-sales-section .client-name-cell span {
        font-size: 18px !important;
        font-weight: 900 !important;
    }

    .assigned-sale-actions {
        flex-direction: row !important;
    }

    .assigned-comments-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
    }
}
