/* =========================================================
   2-й раздел: ширины колонок + комментарии только иконкой
   Раздел: "Деньги в просчетах и работе"
   ========================================================= */

@media (min-width: 951px) {
    .calculation-money-section table {
        width: 100% !important;
        min-width: 1180px !important;
        table-layout: fixed !important;
    }

    /* Клиент */
    .calculation-money-section th:nth-child(1),
    .calculation-money-section td:nth-child(1) {
        width: 330px !important;
    }

    /* Город */
    .calculation-money-section th:nth-child(2),
    .calculation-money-section td:nth-child(2) {
        width: 95px !important;
        max-width: 95px !important;
    }

    /* Тип */
    .calculation-money-section th:nth-child(3),
    .calculation-money-section td:nth-child(3) {
        width: 78px !important;
        max-width: 78px !important;
    }

    /* Деньги */
    .calculation-money-section th:nth-child(4),
    .calculation-money-section td:nth-child(4) {
        width: 120px !important;
        max-width: 120px !important;
        white-space: nowrap !important;
        font-weight: 900 !important;
    }

    /* Статус */
    .calculation-money-section th:nth-child(5),
    .calculation-money-section td:nth-child(5) {
        width: 120px !important;
        max-width: 120px !important;
    }

    /* План */
    .calculation-money-section th:nth-child(6),
    .calculation-money-section td:nth-child(6) {
        width: 130px !important;
        max-width: 130px !important;
    }

    /* Дней */
    .calculation-money-section th:nth-child(7),
    .calculation-money-section td:nth-child(7) {
        width: 44px !important;
        max-width: 44px !important;
        text-align: center !important;
    }

    /* Комментарии — только иконка */
    .calculation-money-section th:nth-child(8),
    .calculation-money-section td:nth-child(8) {
        width: 64px !important;
        max-width: 64px !important;
        text-align: center !important;
    }

    /* Редактировать */
    .calculation-money-section th:nth-child(9),
    .calculation-money-section td:nth-child(9) {
        width: 44px !important;
        max-width: 44px !important;
        text-align: center !important;
    }

    /* В продажу / сделать уже */
    .calculation-money-section th:nth-child(10),
    .calculation-money-section td:nth-child(10) {
        width: 92px !important;
        max-width: 92px !important;
        text-align: center !important;
    }

    /* Удаление */
    .calculation-money-section th:nth-child(11),
    .calculation-money-section td:nth-child(11) {
        width: 44px !important;
        max-width: 44px !important;
        text-align: center !important;
    }

    .calculation-money-section th,
    .calculation-money-section td {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .calculation-money-section .client-name-cell {
        max-width: 100% !important;
    }

    .calculation-money-section .client-name-cell > span {
        max-width: 270px !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .calculation-money-section .money {
        white-space: nowrap !important;
    }

    .calculation-money-section td:nth-child(5) {
        font-weight: 800 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    .calculation-money-section td:nth-child(6) {
        font-size: 13px !important;
        line-height: 1.18 !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: anywhere !important;
    }

    .calculation-comments-icon-cell {
        text-align: center !important;
        overflow: visible !important;
    }

    .calculation-comments-icon-cell .assigned-comments-btn {
        margin: 0 auto !important;
        min-width: 40px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 4px 8px !important;
        border-radius: 999px !important;
        background: #eff6ff !important;
        border: 1px solid #bfdbfe !important;
        color: #1d4ed8 !important;
        font-size: 13px !important;
        font-weight: 900 !important;
    }

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

    .calculation-money-section td:nth-child(10) button,
    .calculation-money-section .btn-transfer-deal,
    .calculation-money-section .btn-sale-plan,
    .calculation-money-section .transfer-narrow-btn {
        min-width: 76px !important;
        max-width: 84px !important;
        min-height: 32px !important;
        padding: 6px 6px !important;
        border-radius: 10px !important;
        font-size: 11px !important;
        line-height: 1.05 !important;
        white-space: nowrap !important;
    }

    .calculation-money-section td:nth-child(9) button,
    .calculation-money-section td:nth-child(11) button {
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
    }


    /* Экшен-кнопки максимально близко друг к другу */
    .calculation-money-section td:nth-child(8),
    .calculation-money-section td:nth-child(9),
    .calculation-money-section td:nth-child(10),
    .calculation-money-section td:nth-child(11) {
        padding-left: 4px !important;
        padding-right: 4px !important;
    }

    .calculation-money-section th:nth-child(8),
    .calculation-money-section th:nth-child(9),
    .calculation-money-section th:nth-child(10),
    .calculation-money-section th:nth-child(11) {
        padding-left: 4px !important;
        padding-right: 4px !important;
        white-space: nowrap !important;
    }

    .calculation-money-section td:nth-child(8) .assigned-comments-btn,
    .calculation-money-section td:nth-child(9) button,
    .calculation-money-section td:nth-child(10) button,
    .calculation-money-section td:nth-child(11) button {
        margin-left: auto !important;
        margin-right: auto !important;
    }

}

@media (max-width: 950px) {
    .calculation-comments-icon-cell {
        display: grid !important;
        grid-template-columns: 96px 1fr !important;
        gap: 8px !important;
        align-items: center !important;
    }

    .calculation-comments-icon-cell::before {
        content: "Комментарии" !important;
        color: #64748b !important;
        font-size: 11px !important;
        font-weight: 900 !important;
    }

    .calculation-comments-icon-cell .assigned-comments-btn {
        justify-self: start !important;
        min-width: 52px !important;
        height: 38px !important;
        min-height: 38px !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: 11px !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;
}
