/* ---------- Filter Grid (центрируем внутри карточки) ---------- */
#filterGrid {
    display: grid;
    grid-template-columns: 150px 150px; /* две колонки с фильтрами */
    grid-template-rows: auto 1fr;       /* первая строка — фильтры, вторая — диаграмма */
    gap: 15px;

    justify-content: center;  /* центрирование всей сетки */
    width: 100%;
    max-width: 500px;         /* чтобы не расползалась слишком широко */
    margin: 0 auto;           /* центрирование самого блока */
    box-sizing: border-box;
}

/* ---------- Фильтры в первой строке ---------- */
.filterItem {
    grid-row: 1;
}

/* ---------- Диаграмма занимает две колонки ---------- */
#boxplotContainer {
    grid-column: 1 / span 2; 
    grid-row: 2;

    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    background: #f9f9f9;

    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;

    display: flex;           
    justify-content: center; 
    align-items: center;     
}

/* ---------- Оформление фильтров ---------- */
.filterItem label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
    font-size: 14px;
    color: #2c3e50;
}

.filterItem select {
    margin-top: 5px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    background: linear-gradient(145deg, #e3f2fd, #ffffff);
    transition: all 0.2s ease;
    cursor: pointer;
    color: #34495e;
}

.filterItem select:hover,
.filterItem select:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 6px rgba(74,144,226,0.5);
    outline: none;
    background: linear-gradient(145deg, #ffffff, #d0e4fc);
}

/* ---------- Адаптивность ---------- */
@media (max-width: 500px) {

    /* Фильтры — две колонки */
    #filterGrid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* две равные колонки */
        grid-template-rows: auto 1fr;   /* фильтры в первой строке, диаграмма — ниже */
        gap: 10px;
        width: 100%;
    }

    /* Диаграмма занимает всю ширину */
    #boxplotContainer {
        grid-column: 1 / span 2;
        width: 100%;
        overflow-x: auto;
    }

    .filterItem label {
        width: 100%;
    }
}

