/* =========================================================
   Компактный вид 2-го раздела и короткие комментарии
   ========================================================= */

/* 2-й раздел: меньше шрифты, ниже строки, аккуратнее столбцы */
.calculation-money-section {
    padding: 14px 16px !important;
}

.calculation-money-section .card-title {
    margin-bottom: 10px !important;
}

.calculation-money-section .card-title h2 {
    font-size: 17px !important;
}

.calculation-money-section .hint {
    font-size: 13px !important;
    margin-top: 4px !important;
}

.calculation-money-section table {
    min-width: 1120px !important;
    table-layout: fixed !important;
}

.calculation-money-section th {
    font-size: 11px !important;
    line-height: 1.15 !important;
    padding: 6px 7px !important;
    white-space: nowrap !important;
}

.calculation-money-section td {
    font-size: 13px !important;
    line-height: 1.2 !important;
    padding: 7px 7px !important;
    vertical-align: middle !important;
}

.calculation-money-section td input,
.calculation-money-section td select {
    font-size: 12px !important;
    min-height: 30px !important;
    height: 30px !important;
    padding: 5px 7px !important;
}

/* Ширины колонок 2-го раздела:
   Клиент / Город / Тип / Деньги / Статус / План / Дней / Комментарий / В сделку / Редактировать / Удаление */
.calculation-money-section th:nth-child(1),
.calculation-money-section td:nth-child(1) {
    width: 160px !important;
    font-weight: 900 !important;
}

.calculation-money-section th:nth-child(2),
.calculation-money-section td:nth-child(2) {
    width: 105px !important;
}

.calculation-money-section th:nth-child(3),
.calculation-money-section td:nth-child(3) {
    width: 82px !important;
}

.calculation-money-section th:nth-child(4),
.calculation-money-section td:nth-child(4) {
    width: 105px !important;
    font-weight: 900 !important;
}

.calculation-money-section th:nth-child(5),
.calculation-money-section td:nth-child(5) {
    width: 118px !important;
}

.calculation-money-section th:nth-child(6),
.calculation-money-section td:nth-child(6) {
    width: 125px !important;
}

.calculation-money-section th:nth-child(7),
.calculation-money-section td:nth-child(7) {
    width: 78px !important;
    text-align: center !important;
}

.calculation-money-section th:nth-child(8),
.calculation-money-section td:nth-child(8) {
    width: 180px !important;
}

.calculation-money-section th:nth-child(9),
.calculation-money-section td:nth-child(9) {
    width: 82px !important;
    text-align: center !important;
}

.calculation-money-section th:nth-child(10),
.calculation-money-section td:nth-child(10) {
    width: 72px !important;
    text-align: center !important;
}

.calculation-money-section th:nth-child(11),
.calculation-money-section td:nth-child(11) {
    width: 92px !important;
    text-align: center !important;
}

/* Кнопки внутри таблицы компактнее */
.calculation-money-section .btn-transfer-deal,
.calculation-money-section .edit-btn,
.calculation-money-section .delete-btn,
.calculation-money-section .btn-delete,
.calculation-money-section button {
    min-height: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    padding: 5px 8px !important;
}

.calculation-money-section .edit-btn {
    width: 34px !important;
    min-width: 34px !important;
    padding: 0 !important;
}

/* Короткий комментарий */
.comment-compact-cell {
    max-width: 180px !important;
}

.comment-preview-btn {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 28px !important;
    height: auto !important;

    display: block !important;
    text-align: left !important;

    padding: 5px 8px !important;
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
    background: #ffffff !important;
    color: #374151 !important;

    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;

    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;

    cursor: pointer !important;
    box-shadow: none !important;
}

.comment-preview-btn:hover {
    background: #f8fafc !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

.comment-empty {
    color: #9ca3af;
    font-size: 12px;
}

/* Окно полного комментария */
.full-comment-modal-box {
    width: 620px !important;
    max-width: 94vw !important;
}

.full-comment-text {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #6b7280;
    border-radius: 12px;
    padding: 14px;
    color: #111827;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 55vh;
    overflow: auto;
}

.full-comment-actions {
    grid-template-columns: 1fr !important;
}

/* Мобильная версия: компактная карточка, комментарий открывается кликом */
@media (max-width: 950px) {
    .calculation-money-section {
        padding: 12px !important;
    }

    .calculation-money-section table {
        min-width: 0 !important;
        table-layout: auto !important;
    }

    .calculation-money-section tr {
        padding: 10px !important;
        border-radius: 12px !important;
    }

    .calculation-money-section td {
        font-size: 13px !important;
        padding: 7px 0 !important;
        grid-template-columns: 96px 1fr !important;
    }

    .comment-compact-cell {
        max-width: 100% !important;
    }

    .comment-preview-btn {
        white-space: normal !important;
        max-height: 42px !important;
        overflow: hidden !important;
        font-size: 12px !important;
        line-height: 1.25 !important;
    }

    .full-comment-modal-box {
        width: 100% !important;
    }

    .full-comment-text {
        max-height: 60vh;
        font-size: 14px;
    }
}
