/* ProfitCore - Компоненты */

/* Карточка этажа */
.floor-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.floor-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.floor-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.floor-card-actions {
    display: flex;
    gap: 5px;
}

/* Карточка помещения */
.room-card {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.room-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.room-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.room-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-copy-room {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #2196F3;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy-room:hover {
    background-color: rgba(33, 150, 243, 0.1);
    color: #1976D2;
    transform: scale(1.1);
}

.room-card-delete {
    cursor: pointer;
    color: #f44336;
    font-size: 20px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.room-card-delete:hover {
    color: #d32f2f;
    background-color: rgba(244, 67, 54, 0.1);
}

.room-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

/* Двухколоночный макет (для экрана помещений) */
.two-column-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.sidebar {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
    height: fit-content;
}

.sidebar-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
}

.sidebar-item {
    padding: 10px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar-item:hover {
    background-color: #f5f5f5;
}

.sidebar-item.active {
    background-color: #2196F3;
    color: white;
}

.main-content {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
}

/* Секция результата */
.result-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.result-section:last-child {
    border-bottom: none;
}

.result-section-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Карточка ПВУ */
.equipment-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.equipment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.equipment-card-model {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.equipment-card-specs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.equipment-spec {
    display: flex;
    flex-direction: column;
}

.equipment-spec-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.equipment-spec-value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.equipment-card-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.equipment-price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    color: #666;
}

.equipment-total-price {
    font-size: 24px;
    font-weight: bold;
    color: #2196F3;
}

/* Кнопка пересчета (крупная) */
.recalculate-button-container {
    text-align: center;
    margin: 30px 0 20px 0;
}

.btn-recalculate {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    transition: all 0.2s ease;
}

.btn-recalculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.4);
}

.btn-recalculate:active {
    transform: translateY(0);
}

/* Итоговый блок */
.total-block {
    background-color: #2196F3;
    color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.total-block-compact {
    padding: 20px 30px;
    margin-top: 15px;
}

.total-block-label {
    font-size: 18px;
    margin-bottom: 10px;
}

.total-block-compact .total-block-label {
    font-size: 16px;
    margin-bottom: 6px;
}

.total-block-value {
    font-size: 36px;
    font-weight: bold;
}

.total-block-compact .total-block-value {
    font-size: 30px;
}

.total-block-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 14px;
}

.total-block-sublabel {
    opacity: 0.95;
}

.total-block-subvalue {
    font-weight: 600;
}

.total-block-profit .total-block-subvalue {
    color: #c8e6c9;
}

/* AI комментарий */
.ai-comment {
    background-color: #e3f2fd;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.ai-comment-icon {
    font-size: 20px;
    margin-right: 10px;
}

.ai-comment-text {
    color: #1976D2;
}

/* Таблица с редактируемыми полями */
.editable-table {
    width: 100%;
    border-collapse: collapse;
}

.editable-table th,
.editable-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.editable-table th {
    background-color: #f5f5f5;
    font-weight: bold;
    white-space: nowrap;
}

.editable-table td {
    white-space: nowrap;
}

.editable-table input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-width: 80px;
}

.editable-table input:focus {
    outline: none;
    border-color: #2196F3;
}

.edited-indicator {
    color: #ff9800;
    margin-left: 5px;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: bold;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #666;
}

.modal-close:hover {
    color: #333;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Примечание */
.note {
    background-color: #b9dfaa;
    border-left: 4px solid #66d157;
    padding: 5px;
    margin: 11px 0;
    font-style: italic;
    color: #3f3e3e;
}

.mobile-table-hint {
    display: none;
}

@media (max-width: 768px) {
    .mobile-table-hint {
        display: block;
    }
}

/* Поле только для чтения */
.readonly-field {
    background-color: #f5f5f5;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #666;
}

/* Сетка для карточек */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Плавающая кнопка добавления */
.floating-add-btn {
    position: fixed;
    bottom: 100px;
    right: 40px;
    z-index: 100;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-add-btn .btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.floating-add-btn .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2) !important;
}

.floating-add-btn .btn:active {
    transform: translateY(0);
}

/* Карточки параметров помещений */
.room-params-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px 12px;
    margin-bottom: 10px;
    height: 195px;
    box-sizing: border-box;
}

.room-params-header {
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.room-params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 10px;
}

.room-params-field {
    display: flex;
    flex-direction: column;
}

.room-params-field label {
    font-size: 11px;
    font-weight: bold;
    color: #666;
    margin-bottom: 3px;
}

.room-param-input,
.room-param-select {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    transition: border-color 0.2s, background-color 0.2s;
}

.room-param-input:focus,
.room-param-select:focus {
    outline: none;
    border-color: #2196F3;
    background-color: #f0f8ff;
}

/* Чекбоксы как отдельные ячейки grid */
.room-params-checkbox-field {
    display: flex;
    align-items: center;
}

.room-params-checkbox-field label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: normal;
    color: #555;
    cursor: pointer;
    margin-bottom: 0;
}

.room-param-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Адаптивность для узких экранов */
@media (max-width: 1200px) {
    .room-params-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .room-params-checkboxes {
        grid-column: span 2;
    }

    .equipment-card-specs {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-column-layout {
        grid-template-columns: 200px 1fr;
        gap: 15px;
    }

    /* Карточки параметров помещений */
    .room-params-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    /* Переход на одну колонку для сложных форм */
    .two-column-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Карточка этажа */
    .floor-card {
        padding: 12px;
    }

    .floor-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .floor-card-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .floor-card-actions .btn {
        flex: 1;
        min-width: 80px;
    }

    /* Карточка помещения */
    .room-card {
        padding: 12px;
    }

    .room-card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Двухколоночный макет становится одноколоночным */
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .sidebar {
        position: sticky;
        top: 10px;
        z-index: 10;
        overflow-x: auto;
        white-space: nowrap;
        padding: 10px;
    }

    .sidebar-title {
        font-size: 14px;
        margin-bottom: 10px;
        white-space: normal;
    }

    #floors-sidebar {
        display: flex;
        gap: 8px;
    }

    .sidebar-item {
        padding: 8px 16px;
        font-size: 13px;
        display: inline-block;
        white-space: nowrap;
        min-width: 100px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        padding: 15px;
    }

    /* Секции результата */
    .result-section {
        margin-bottom: 30px;
        padding-bottom: 20px;
    }

    .result-section-title {
        font-size: 18px;
    }

    /* Карточка оборудования */
    .equipment-card {
        padding: 15px;
    }

    .equipment-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .equipment-card-model {
        font-size: 16px;
    }

    .equipment-card-specs {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .equipment-card-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .equipment-total-price {
        font-size: 20px;
    }

    /* Кнопка пересчета */
    .btn-recalculate {
        padding: 12px 30px;
        font-size: 16px;
        width: 100%;
    }

    .recalculate-button-container {
        margin: 20px 0 15px 0;
    }

    /* Итоговый блок */
    .total-block {
        padding: 20px 15px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .total-block-label {
        font-size: 16px;
    }

    .total-block-value {
        font-size: 28px;
    }

    .total-block-compact {
        padding: 15px 20px;
    }

    .total-block-compact .total-block-value {
        font-size: 24px;
    }

    /* AI комментарий */
    .ai-comment {
        padding: 12px;
        font-size: 13px;
    }

    .ai-comment-icon {
        font-size: 18px;
    }

    /* Таблица с редактируемыми полями */
    .editable-table th,
    .editable-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    .editable-table input {
        padding: 4px;
        font-size: 13px;
    }

    /* Модальное окно */
    .modal-content {
        width: 95%;
        padding: 20px;
        max-height: 90vh;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-close {
        font-size: 24px;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Примечание */
    .note {
        padding: 12px;
        font-size: 10px;
        margin: 12px 0;
    }

    /* Сетка карточек */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Плавающая кнопка */
    .floating-add-btn {
        bottom: 20px;
        right: 20px;
    }

    .floating-add-btn .btn {
        padding: 10px 20px;
        font-size: 14px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    /* Параметры помещений */
    .room-params-card {
        height: auto;
        padding: 10px;
    }

    .room-params-header {
        font-size: 16px;
    }

    .room-params-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .room-params-checkboxes {
        grid-column: span 1;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .room-params-field label {
        font-size: 12px;
    }

    .room-param-input,
    .room-param-select {
        padding: 6px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Карточки */
    .floor-card,
    .room-card,
    .equipment-card {
        padding: 10px;
    }

    .floor-card-title,
    .room-card-title {
        font-size: 14px;
    }

    /* Боковая панель */
    .sidebar {
        padding: 10px;
    }

    .sidebar-item {
        padding: 6px;
        font-size: 12px;
    }

    .main-content {
        padding: 12px;
    }

    /* Оборудование */
    .equipment-card-model {
        font-size: 15px;
    }

    .equipment-spec-label {
        font-size: 11px;
    }

    .equipment-spec-value {
        font-size: 14px;
    }

    /* Итоговый блок */
    .total-block {
        padding: 15px 10px;
    }

    .total-block-label {
        font-size: 14px;
    }

    .total-block-value {
        font-size: 24px;
    }

    /* Модальное окно */
    .modal-content {
        padding: 15px;
    }

    /* Плавающая кнопка */
    .floating-add-btn {
        bottom: 15px;
        right: 15px;
    }

    .floating-add-btn .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Вкладки для справочника */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
}

.tab-button {
    background-color: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-button:hover {
    color: #2196F3;
    background-color: #f5f5f5;
}

.tab-button.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
    font-weight: 600;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
}

/* Форма в модальном окне */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    font-size: 14px;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Кнопки */
.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.btn-small:hover {
    background-color: #f5f5f5;
    border-color: #2196F3;
    color: #2196F3;
}

.btn-small.btn-danger {
    color: #f44336;
    border-color: #f44336;
}

.btn-small.btn-danger:hover {
    background-color: #f44336;
    color: white;
}

/* Адаптивность для вкладок */
@media (max-width: 768px) {
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Адаптивность для предупреждений об изменении цен */
    .price-change-item > div {
        font-size: 13px;
    }
    
    .price-change-item > div > div {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

/* Стили для предупреждений об изменении цен */
.price-changes-warning h3 {
    margin-top: 0;
    color: #856404;
}

.price-change-item {
    transition: transform 0.2s ease;
}

.price-change-item:hover {
    transform: translateX(5px);
}

.price-change-item:last-child {
    margin-bottom: 0 !important;
}

/* Информационное сообщение (зеленый блок) */
.info-message {
    background-color: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: transform 0.2s ease;
}

.info-message:hover {
    transform: translateX(5px);
}

/* Стили для корзины */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Логотип в шапке — на всех страницах слева вверху */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.site-logo {
    display: block;
    min-width: 100px;
    min-height: 90px;
    width: 150px;
    height: 135px;
    flex-shrink: 0;
}

.site-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.dashboard-card-title {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

.dashboard-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

.dashboard-card-sub {
    font-size: 0.8rem;
    color: #888;
    margin-top: 4px;
}

.dashboard-charts {
    margin-top: 24px;
}

.dashboard-pie-section {
    max-width: 400px;
}

.dashboard-pie-section h3 {
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.dashboard-pie {
    width: 200px;
    height: 200px;
}

.pie-svg {
    width: 100%;
    height: 100%;
}

.dashboard-pie-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 12px;
    font-size: 0.85rem;
}

.pie-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pie-legend-item i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Статус сделки — цвета фона */
.deal-status-select {
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
}
.deal-status-select.deal-status-draft { background-color: #9e9e9e; color: #fff; border-color: #757575; }
.deal-status-select.deal-status-sent { background-color: #ffeb3b; color: #333; border-color: #fbc02d; }
.deal-status-select.deal-status-onagreement { background-color: #ff9800; color: #fff; border-color: #e65100; }
.deal-status-select.deal-status-inprogress { background-color: #2196f3; color: #fff; border-color: #1976d2; }
.deal-status-select.deal-status-realized { background-color: #4caf50; color: #fff; border-color: #388e3c; }
.deal-status-select.deal-status-closed { background-color: #f44336; color: #fff; border-color: #d32f2f; }

/* Кнопки в шапке главной — только иконки, один размер */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-header-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #ddd;
    background-color: white;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-header-icon:hover {
    background-color: #f0f0f0;
    border-color: #2196F3;
    color: #2196F3;
}

.btn-header-icon.btn-primary {
    border-color: #2196F3;
    background-color: #2196F3;
    color: white;
}

.btn-header-icon.btn-primary:hover {
    background-color: #1976D2;
    border-color: #1976D2;
    color: white;
}

.btn-header-icon svg {
    width: 20px;
    height: 20px;
}

/* Кнопки действий в таблице — единый размер */
.table td.actions {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-action-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.btn-action-icon:hover {
    background-color: #f5f5f5;
    border-color: #2196F3;
    color: #2196F3;
}

.btn-action-icon.btn-primary {
    border-color: #2196F3;
    color: #2196F3;
}

.btn-action-icon.btn-primary:hover {
    background-color: #2196F3;
    color: white;
}

.btn-action-icon.btn-danger {
    border-color: #e0e0e0;
    color: #f44336;
}

.btn-action-icon.btn-danger:hover {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

/* Кнопка избранного (звезда) — тот же размер */
.btn-favorite {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    background-color: transparent;
    border: 1px solid #ddd;
    color: #999;
    font-size: 16px;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-favorite:hover {
    border-color: #FFD700;
    color: #FFD700;
}

.btn-favorite.active {
    border-color: #FFD700;
    color: #FFD700;
    background-color: rgba(255, 215, 0, 0.1);
}

.btn-favorite.active:hover {
    background-color: rgba(255, 215, 0, 0.2);
}

/* Карточки избранных расчётов */
.favorite-card {
    background: white;
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.favorite-card:hover {
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.favorite-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.favorite-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.btn-favorite-remove {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #FFD700;
    transition: transform 0.2s ease;
}

.btn-favorite-remove:hover {
    transform: scale(1.2) rotate(15deg);
}

.favorite-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.favorite-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.favorite-card-label {
    color: #666;
    font-weight: 500;
}

.favorite-card-price {
    color: #2196F3;
    font-weight: bold;
    font-size: 16px;
}

/* Адаптивность для карточек избранных */
@media (max-width: 768px) {
    .favorite-card {
        padding: 12px;
    }
    
    .favorite-card-title {
        font-size: 14px;
    }
    
    .favorite-card-info {
        font-size: 13px;
    }
    
    .favorite-card-price {
        font-size: 14px;
    }
}

/* Стили для корзины */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.calculation-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.calculation-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.calculation-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.calculation-card .card-body {
    padding: 15px;
}

.calculation-card .calculation-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.calculation-card .detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calculation-card .detail-item .label {
    font-size: 0.9em;
    color: #6c757d;
}

.calculation-card .detail-item .value {
    font-weight: 500;
    color: #212529;
}

.calculation-card .card-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

@media (max-width: 768px) {
    .actions-bar {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .calculation-card .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .calculation-card .calculation-details {
        grid-template-columns: 1fr;
    }
    
    .calculation-card .card-actions {
        flex-direction: column;
    }
}

/* Панель фильтров */
.filters-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    padding: 20px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
    flex: 1;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

.filter-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* Сортируемые заголовки таблицы */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.sortable:hover {
    background-color: #f5f5f5;
}

.sort-indicator {
    display: inline-block;
    margin-left: 5px;
    font-size: 12px;
    color: #2196F3;
    font-weight: bold;
}

.sort-indicator.sort-asc,
.sort-indicator.sort-desc {
    color: #2196F3;
}

/* Адаптивность для панели фильтров */
@media (max-width: 768px) {
    .filters-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
}

/* Сворачиваемые таблицы в отчёте */
.result-table-collapsible {
    margin-bottom: 15px;
}

.result-table-collapsible .result-table-collapsible-body {
    margin-top: 10px;
}

.result-table-collapsible.collapsed .result-table-collapsible-body {
    display: none;
}

.btn-toggle-table {
    padding: 6px 12px;
    font-size: 14px;
    border: 1px solid #6c757d;
    background-color: #6c757d;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.btn-toggle-table:hover {
    background-color: #5a6268;
    border-color: #545b62;
}
