/* Стили редактора данных - Динамические размеры */

/* Модальное окно - основной контейнер с динамическими размерами */
.data-editor-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    z-index: 2000;
    padding: calc(10px + 1vh);
    overflow: auto;
}

.data-editor-modal-overlay.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.data-editor-modal {
    background: white;
    border-radius: var(--radius-lg, 12px);
    width: calc(100% - 20px);
    max-width: var(--modal-max-width, 1168px);
    max-height: calc(100vh - 20px);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,0.2));
    animation: modalSlideIn 0.3s ease;
    margin: auto;
}

/* Заголовок редактора - динамические размеры */
.data-editor-header {
    padding: calc(8px + 0.5vh) calc(12px + 1vw);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: calc(8px + 0.5vh);
    width: 100%;
    flex-shrink: 0;
}

.data-editor-header h2 {
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    color: var(--primary-color, #1a5f2a);
    margin: 0;
    flex: 1 1 auto;
}

/* Верхняя часть заголовка - кнопка восстановления и заголовок */
.data-editor-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(8px + 0.5vw);
    width: 100%;
    flex-wrap: wrap;
}

/* Вкладки редактора - динамические */
.data-editor-tabs {
    display: flex;
    gap: calc(4px + 0.5vw);
    flex-wrap: wrap;
    flex: 1 1 auto;
    min-width: min-content;
}

.tab-btn {
    padding: calc(6px + 0.3vh) calc(10px + 1vw);
    border: none;
    background: var(--secondary-color, #f3f4f6);
    color: var(--text-color, #374151);
    border-radius: var(--radius-sm, 6px);
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast, 0.2s);
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: min-content;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-btn:hover {
    background: #e5e7eb;
}

.tab-btn.active {
    background: var(--primary-color, #1a5f2a);
    color: white;
}

/* Фильтры для таблицы автомобилей - динамические размеры */
.cars-filters {
    display: flex;
    gap: calc(6px + 0.5vw);
    align-items: center;
    padding: calc(6px + 0.5vh) 0;
    flex-wrap: wrap;
    width: 100%;
}

.cars-filters .form-select {
    padding: calc(4px + 0.2vh) calc(6px + 0.4vw);
    font-size: 10px !important;
    border-radius: var(--radius-sm, 6px);
    border: 1.5px solid var(--border-color, #e5e7eb);
    background: white;
    cursor: pointer;
    flex: 1 1 calc(20% - 10px);
    min-width: 100px;
    max-width: none;
    font-weight: 500;
    color: var(--text-color, #374151);
    transition: all var(--transition-fast, 0.2s);
    height: auto !important;
    min-height: 26px;
    line-height: 1.2 !important;
    box-sizing: border-box;
}

.cars-filters .form-select:hover {
    border-color: var(--primary-light, #22c55e);
}

.cars-filters .form-select:focus {
    outline: none;
    border-color: var(--primary-color, #1a5f2a);
    box-shadow: 0 0 0 2px rgba(26, 95, 42, 0.1);
}

.cars-filters .form-select:disabled {
    background-color: var(--secondary-color, #f3f4f6);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Подвкладки для категорий данных - динамические размеры */
.pricing-subtabs {
    display: flex;
    gap: calc(2px + 0.3vw);
    padding: calc(6px + 0.3vh) calc(12px + 1vw);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    min-height: calc(36px + 1vh);
    max-height: calc(60px + 2vh);
    align-items: center;
    flex-shrink: 0;
}

.subtab-btn {
    padding: calc(6px + 0.2vh) calc(8px + 0.5vw);
    border: none;
    background: transparent;
    color: var(--text-color, #374151);
    border-radius: var(--radius-sm, 6px);
    font-size: clamp(0.65rem, 1.1vw, 0.8rem);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast, 0.2s);
    white-space: nowrap;
    flex: 0 0 auto;
    height: auto;
    min-height: 28px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    max-width: max-content;
}

.subtab-btn:hover {
    background: var(--secondary-color, #f3f4f6);
}

.subtab-btn.active {
    background: var(--primary-color, #1a5f2a);
    color: white;
}

/* Контент вкладок */
.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
    min-height: 0;
}

.tab-content.active {
    display: flex;
}

/* Таблицы данных - динамические размеры */
.data-table-wrapper {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    padding: 0 calc(12px + 1vw) calc(8px + 0.5vh);
    width: 100%;
    max-width: 100%;
    min-height: 150px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.7rem, 1.3vw, 0.9rem);
    table-layout: auto;
}

/* Колонки таблицы с динамической шириной */
.data-table th,
.data-table td {
    padding: calc(4px + 0.3vh) calc(6px + 0.3vw);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.data-table th {
    background: var(--secondary-color, #f3f4f6);
    font-weight: 600;
    color: var(--text-color, #374151);
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    position: sticky;
    top: 0;
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    z-index: 1;
}

.data-table tr:hover {
    background-color: #f8fff8;
}

.data-table tr:nth-child(even) {
    background-color: #fafafa;
}

.data-table tr:nth-child(even):hover {
    background-color: #f8fff8;
}

/* Динамические ширины колонок */
.data-table th.cell-brand,
.data-table td.cell-brand {
    width: auto;
    min-width: 60px;
    max-width: 100px;
    flex: 0 1 10%;
}

.data-table th.cell-model,
.data-table td.cell-model {
    width: auto;
    min-width: 70px;
    max-width: 120px;
    flex: 0 1 15%;
}

.data-table th.cell-trim,
.data-table td.cell-trim {
    width: auto;
    min-width: 80px;
    max-width: 140px;
    flex: 0 1 18%;
}

.data-table th.cell-year,
.data-table td.cell-year {
    width: auto;
    min-width: 45px;
    max-width: 60px;
    flex: 0 1 6%;
    text-align: center;
}

/* Колонки для разных категорий - по умолчанию скрыты */
.data-table th.col-price-1,
.data-table th.col-price-2,
.data-table th.col-discount,
.data-table th.col-compensation,
.data-table td.col-price-1,
.data-table td.col-price-2,
.data-table td.col-discount,
.data-table td.col-compensation {
    display: none;
    width: auto !important;
    max-width: 120px !important;
}

/* Показываем колонки для активной категории */
.pricing-subtabs[data-active-tab="rrc"] ~ .data-table-wrapper .col-price-1,
.pricing-subtabs[data-active-tab="rrc"] ~ .data-table-wrapper .col-price-2 {
    display: table-cell;
}

.pricing-subtabs[data-active-tab="direct"] ~ .data-table-wrapper .col-discount,
.pricing-subtabs[data-active-tab="direct"] ~ .data-table-wrapper .col-compensation {
    display: table-cell;
}

.pricing-subtabs[data-active-tab="loyal_trade"] ~ .data-table-wrapper .col-discount,
.pricing-subtabs[data-active-tab="loyal_trade"] ~ .data-table-wrapper .col-compensation {
    display: table-cell;
}

.pricing-subtabs[data-active-tab="regular_trade"] ~ .data-table-wrapper .col-discount,
.pricing-subtabs[data-active-tab="regular_trade"] ~ .data-table-wrapper .col-compensation {
    display: table-cell;
}

.pricing-subtabs[data-active-tab="credit"] ~ .data-table-wrapper .col-discount,
.pricing-subtabs[data-active-tab="credit"] ~ .data-table-wrapper .col-compensation {
    display: table-cell;
}

.pricing-subtabs[data-active-tab="tires"] ~ .data-table-wrapper .col-discount,
.pricing-subtabs[data-active-tab="tires"] ~ .data-table-wrapper .col-compensation {
    display: table-cell;
}

.pricing-subtabs[data-active-tab="fleet"] ~ .data-table-wrapper .col-discount,
.pricing-subtabs[data-active-tab="fleet"] ~ .data-table-wrapper .col-compensation {
    display: table-cell;
}

.pricing-subtabs[data-active-tab="leasing"] ~ .data-table-wrapper .col-discount,
.pricing-subtabs[data-active-tab="leasing"] ~ .data-table-wrapper .col-compensation {
    display: table-cell;
}

.data-table th.col-price-1,
.data-table th.col-price-2,
.data-table th.col-discount,
.data-table th.col-compensation,
.data-table td.col-price-1,
.data-table td.col-price-2,
.data-table td.col-discount,
.data-table td.col-compensation {
    width: auto;
    min-width: 80px;
    flex: 0 1 14%;
    text-align: right;
}

/* Редактируемые ячейки */
.cell-editable {
    min-width: 70px;
    max-width: 150px;
    padding: 2px 4px;
}

/* Мобильная адаптация редактируемых ячеек */
@media (max-width: 768px) {
    .cell-editable {
        min-width: 45px;
        max-width: 80px;
        padding: 1px 2px;
        width: 100%;
        box-sizing: border-box;
    }
}

.edit-input {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    font-size: 10px !important;
    text-align: right;
    background: white;
    transition: all var(--transition-fast, 0.2s);
    min-width: 40px;
    max-width: 100%;
    box-sizing: border-box;
    height: auto !important;
    min-height: 18px;
    max-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2 !important;
}

/* Адаптация для экранов меньше 768px */
@media (max-width: 768px) {
    .edit-input {
        font-size: 10px;
        min-height: 18px;
        max-height: 24px;
        padding: 1px 3px;
    }
}

/* Адаптация для экранов меньше 1024px */
@media (max-width: 1024px) {
    .edit-input {
        font-size: 10px;
        min-height: 18px;
        max-height: 24px;
        padding: 1px 3px;
    }
}

/* Адаптация для экранов меньше 480px */
@media (max-width: 480px) {
    .edit-input {
        font-size: 9px;
        min-height: 16px;
        max-height: 22px;
        padding: 1px 2px;
    }
}

.edit-input:hover {
    border-color: var(--primary-light, #22c55e);
}

.edit-input:focus {
    outline: none;
    border-color: var(--primary-color, #1a5f2a);
    box-shadow: 0 0 0 2px rgba(26, 95, 42, 0.1);
}

/* Ячейки с данными */
.cell-brand,
.cell-model,
.cell-trim {
    font-weight: 500;
    color: var(--text-color, #374151);
}

.cell-year {
    font-weight: 600;
    color: var(--primary-color, #1a5f2a);
    text-align: center;
}

/* Футер редактора */
.data-editor-footer {
    padding: calc(8px + 0.5vh) calc(12px + 1vw);
    border-top: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    justify-content: flex-end;
    gap: calc(8px + 0.5vw);
    background: var(--secondary-color, #f3f4f6);
    border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Адаптивность для разных экранов */

/* Планшеты */
@media (max-width: 1024px) {
    .data-editor-modal {
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 10px);
    }

    .data-editor-header {
        padding: calc(8px + 0.3vh) calc(10px + 0.5vw);
    }

    .cars-filters .form-select {
        flex: 1 1 calc(25% - 8px);
        min-width: 80px;
    }

    .subtab-btn {
        padding: calc(5px + 0.2vh) calc(8px + 0.3vw);
        font-size: clamp(0.6rem, 1vw, 0.75rem);
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .data-editor-modal-overlay {
        padding: 5px;
    }

    .data-editor-modal {
        max-height: calc(100vh - 10px);
        border-radius: var(--radius-md, 8px);
    }

    .data-editor-header {
        padding: calc(6px + 0.3vh) calc(8px + 0.5vw);
        gap: calc(6px + 0.3vh);
    }

    .data-editor-header h2 {
        font-size: clamp(0.85rem, 2vw, 1rem);
    }

    .data-editor-header-top {
        flex-direction: row;
        align-items: center;
    }

    .data-editor-tabs {
        width: 100%;
        justify-content: flex-start;
    }

    .tab-btn {
        flex: 1 1 45%;
        text-align: center;
        padding: calc(6px + 0.2vh) calc(8px + 0.5vw);
        font-size: clamp(0.65rem, 1.5vw, 0.8rem);
        max-width: none;
    }

    .pricing-subtabs {
        padding: calc(4px + 0.2vh) calc(8px + 0.5vw);
        gap: 3px;
        min-height: calc(32px + 0.5vh);
    }

    .subtab-btn {
        padding: calc(5px + 0.2vh) calc(6px + 0.3vw);
        font-size: clamp(0.6rem, 1.3vw, 0.7rem);
        min-height: 26px;
    }

    .data-table-wrapper {
        padding: calc(6px + 0.3vh) calc(8px + 0.5vw);
    }

    .data-table {
        font-size: clamp(0.65rem, 1.5vw, 0.8rem);
    }

    .data-table th,
    .data-table td {
        padding: calc(3px + 0.2vh) calc(4px + 0.2vw);
        max-width: 100px;
    }

    /* Мобильная адаптация колонок */
    .data-table th.cell-brand,
    .data-table td.cell-brand {
        min-width: 50px;
        max-width: 70px;
        flex: 0 1 8%;
    }

    .data-table th.cell-model,
    .data-table td.cell-model {
        min-width: 60px;
        max-width: 90px;
        flex: 0 1 12%;
    }

    .data-table th.cell-trim,
    .data-table td.cell-trim {
        min-width: 65px;
        max-width: 100px;
        flex: 0 1 15%;
    }

    .data-table th.cell-year,
    .data-table td.cell-year {
        min-width: 40px;
        max-width: 50px;
        flex: 0 1 5%;
    }

    .data-table th.col-price-1,
    .data-table th.col-price-2,
    .data-table th.col-discount,
    .data-table th.col-compensation,
    .data-table td.col-price-1,
    .data-table td.col-price-2,
    .data-table td.col-discount,
    .data-table td.col-compensation {
        min-width: 60px;
        max-width: 80px;
        flex: 0 1 10%;
    }

    .edit-input {
        padding: 1px 2px;
        font-size: clamp(0.5rem, 1.3vw, 0.6rem);
        min-width: 30px;
        max-width: 100%;
        min-height: 18px;
        max-height: 24px;
        line-height: 1.2;
        box-sizing: border-box;
    }
    
    /* Также применяем для небольших планшетов */
    @media (max-width: 1024px) {
        .edit-input {
            font-size: clamp(0.55rem, 1.2vw, 0.7rem);
        }
    }

    .cell-editable {
        min-width: 55px;
        max-width: 80px;
    }

    /* Mobile filters - 4 dropdowns in one row */
    .cars-filters {
        padding: calc(4px + 0.3vh) 0;
        gap: calc(4px + 0.3vw);
    }

    .cars-filters .form-select {
        font-size: 9px !important;
        padding: calc(3px + 0.1vh) calc(5px + 0.2vw);
        flex: 1 1 calc(25% - 6px);
        min-width: 0;
        height: auto !important;
        min-height: 22px;
    }

    .data-editor-footer {
        padding: calc(8px + 0.3vh) calc(8px + 0.5vw);
        flex-direction: column;
    }

    .data-editor-footer .btn {
        width: 100%;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .data-editor-modal-overlay {
        padding: 3px;
    }

    .data-editor-modal {
        max-width: calc(100vw - 6px);
    }

    .data-editor-header h2 {
        font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    }

    .tab-btn {
        flex: 1 1 45%;
        font-size: clamp(0.6rem, 1.8vw, 0.75rem);
        padding: calc(5px + 0.2vh) calc(6px + 0.3vw);
    }

    /* Filters wrap to 2 rows */
    .cars-filters {
        flex-wrap: wrap;
    }

    .cars-filters .form-select {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
        font-size: 8px !important;
    }

    .pricing-subtabs {
        min-height: calc(28px + 0.5vh);
    }

    .subtab-btn {
        font-size: clamp(0.55rem, 1.8vw, 0.65rem);
        padding: calc(4px + 0.1vh) calc(5px + 0.2vw);
        min-height: 24px;
    }

    /* Колонки на очень маленьких экранах */
    .data-table th,
    .data-table td {
        max-width: 80px;
    }

    .data-table th.cell-brand,
    .data-table td.cell-brand {
        min-width: 45px;
        max-width: 60px;
        flex: 0 1 7%;
    }

    .data-table th.cell-model,
    .data-table td.cell-model {
        min-width: 55px;
        max-width: 80px;
        flex: 0 1 10%;
    }

    .data-table th.cell-trim,
    .data-table td.cell-trim {
        min-width: 60px;
        max-width: 90px;
        flex: 0 1 13%;
    }

    .data-table th.cell-year,
    .data-table td.cell-year {
        min-width: 35px;
        max-width: 45px;
        flex: 0 1 4%;
    }

    .data-table th.col-price-1,
    .data-table th.col-price-2,
    .data-table th.col-discount,
    .data-table th.col-compensation,
    .data-table td.col-price-1,
    .data-table td.col-price-2,
    .data-table td.col-discount,
    .data-table td.col-compensation {
        min-width: 55px;
        max-width: 70px;
        flex: 0 1 9%;
    }
}

/* Скрытие стрелочек в полях ввода чисел */
.edit-input[type="number"]::-webkit-outer-spin-button,
.edit-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.edit-input[type="number"] {
    -moz-appearance: textfield;
    appearance: none;
}

/* Анимация появления модального окна */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для оборудования */
.eq-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 200px;
}

.eq-short-name {
    font-weight: 500;
    color: var(--text-color, #374151);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.eq-full-name {
    font-size: 0.75rem;
    color: var(--text-light, #9ca3af);
}

.eq-group-badge {
    font-size: clamp(0.6rem, 1vw, 0.7rem);
    color: var(--primary-color, #1a5f2a);
    background: #e8f5e8;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 2px;
    white-space: nowrap;
}

.eq-options-info {
    font-size: 0.8rem;
    color: var(--text-light, #9ca3af);
    font-style: italic;
}

/* Кнопки действий */
.cell-actions {
    width: auto;
    min-width: 40px;
    text-align: center;
    flex: 0 0 auto;
}

.btn-icon {
    width: calc(24px + 1vw);
    height: calc(24px + 1vw);
    max-width: 32px;
    max-height: 32px;
    border: none;
    border-radius: var(--radius-sm, 6px);
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast, 0.2s);
    color: var(--text-light, #9ca3af);
    flex: 0 0 auto;
}

.btn-icon:hover {
    background: var(--secondary-color, #f3f4f6);
}

.btn-icon.btn-delete:hover {
    background: #fee2e2;
    color: var(--error-color, #ef4444);
}

.btn-icon.btn-edit:hover {
    background: #e0f2fe;
    color: var(--compensation-color, #3b82f6);
}

/* Таблица оборудования в редакторе данных */
.equipment-table {
    table-layout: fixed;
}

.equipment-table th.cell-name,
.equipment-table td.cell-name {
    width: 50%;
    min-width: 200px;
    max-width: 300px;
}

.equipment-table th:not(.cell-name),
.equipment-table td:not(.cell-name) {
    width: 25%;
    min-width: 100px;
    max-width: 150px;
    text-align: right;
}

/* Поля ввода в таблице оборудования */
#equipment-tab .edit-input {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    font-size: 10px !important;
    text-align: right;
    background: white;
    transition: all var(--transition-fast, 0.2s);
    min-width: 60px;
    max-width: 100%;
    box-sizing: border-box;
    height: auto !important;
    min-height: 18px;
    max-height: 24px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2 !important;
}

#equipment-tab .edit-input:hover {
    border-color: var(--primary-light, #22c55e);
}

#equipment-tab .edit-input:focus {
    outline: none;
    border-color: var(--primary-color, #1a5f2a);
    box-shadow: 0 0 0 2px rgba(26, 95, 42, 0.1);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    #equipment-tab .edit-input {
        font-size: 10px !important;
        min-height: 18px;
        max-height: 24px;
        padding: 1px 3px;
        min-width: 50px;
    }
    
    .equipment-table th.cell-name,
    .equipment-table td.cell-name {
        width: 40%;
        min-width: 120px;
        max-width: 200px;
    }
    
    .equipment-table th:not(.cell-name),
    .equipment-table td:not(.cell-name) {
        width: 30%;
        min-width: 70px;
        max-width: 100px;
    }
}

/* Адаптация для небольших экранов */
@media (max-width: 480px) {
    #equipment-tab .edit-input {
        font-size: 9px !important;
        min-height: 16px;
        max-height: 22px;
        padding: 1px 2px;
        min-width: 40px;
    }
}

/* Таблица опций */
.options-table {
    width: 100%;
    border-collapse: collapse;
    margin: calc(4px + 0.5vh) 0;
    table-layout: fixed;
}

.options-table th,
.options-table td {
    padding: calc(4px + 0.3vh) calc(6px + 0.3vw);
    text-align: left;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.options-table th {
    background: var(--secondary-color, #f3f4f6);
    font-weight: 600;
    font-size: clamp(0.65rem, 1.1vw, 0.8rem);
}

.options-table th:first-child,
.options-table td:first-child {
    width: auto;
    min-width: 100px;
    text-align: left;
}

.options-table th:not(:first-child),
.options-table td:not(:first-child) {
    width: 25%;
    min-width: 80px;
    text-align: right;
}

.options-table td.cell-editable {
    min-width: 70px;
}

.options-table .option-row:hover {
    background-color: #f0fdf4;
}

.options-table .edit-input {
    padding: calc(3px + 0.2vh) calc(6px + 0.3vw);
    font-size: clamp(0.7rem, 1.1vw, 0.8rem);
}

/* Контейнер для опций группы */
.group-options-container {
    max-height: calc(300px + 20vh);
    overflow-y: auto;
    padding: calc(2px + 0.2vh) 0;
}

.group-options-container .options-table {
    margin: 0;
}

.group-options-container .options-table th {
    padding: calc(4px + 0.2vh) calc(6px + 0.3vw);
}

.group-options-container .options-table td {
    padding: calc(4px + 0.2vh) calc(6px + 0.3vw);
}

/* Модальное окно добавления автомобиля */
.add-car-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 2100;
    align-items: center;
    justify-content: center;
    padding: calc(10px + 1vh);
}

.add-car-modal-overlay.active {
    display: flex;
}

.add-car-modal {
    background: white;
    border-radius: var(--radius-lg, 12px);
    width: calc(100% - 20px);
    max-width: calc(500px - 20px);
    max-height: calc(90vh - 20px);
    overflow: auto;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0,0,0,0.2));
    display: flex;
    flex-direction: column;
}

.add-car-modal h3 {
    padding: calc(12px + 0.5vh) calc(16px + 1vw);
    margin: 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: var(--primary-color, #1a5f2a);
    flex-shrink: 0;
}

.add-car-form {
    padding: calc(16px + 1vh) calc(16px + 1vw);
    flex: 1;
    overflow-y: auto;
}

.form-row {
    margin-bottom: calc(12px + 0.5vh);
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row label {
    display: block;
    font-weight: 500;
    margin-bottom: calc(4px + 0.2vh);
    color: var(--text-color, #374151);
    font-size: clamp(0.75rem, 1.3vw, 0.9rem);
}

.form-row input,
.form-row select {
    width: 100%;
    padding: calc(8px + 0.3vh) calc(10px + 0.5vw);
    border: 1.5px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-sm, 6px);
    font-size: clamp(0.8rem, 1.4vw, 0.95rem);
    box-sizing: border-box;
}

.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--primary-color, #1a5f2a);
    box-shadow: 0 0 0 3px rgba(26, 95, 42, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: calc(8px + 0.5vw);
    padding: calc(12px + 0.5vh) calc(16px + 1vw);
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--secondary-color, #f3f4f6);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.form-actions .btn {
    flex: 0 1 auto;
    min-width: max-content;
    max-width: 100%;
    white-space: nowrap;
}

/* Модальное окно добавления автомобиля на мобильных */
@media (max-width: 520px) {
    .add-car-modal {
        max-width: calc(100vw - 16px);
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}