.analytics-wrapper {
    width: 100%;
    flex: 1;
}

/* Сортировка */
.sorting-section {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    margin: 15px 0;
    gap: 15px;
    position: relative;
}

.sorting-section .block {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 45px;
    background-color: #FFFFFF;
    padding: 0 15px;
    border-radius: 8px;
}

.sorting-section .block span {
    margin: 0 10px;
}

.sorting-section p {
    color: #222222;
    font-size: 18px;
    font-weight: 600;
}

.date-block {
    position: relative;
}

.sorting-section .block.date-block {
    background-color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
}

.sorting-section .block.date-block span {
    margin: 0 10px;
    font-size: 14px;
    color: #6C6C6C;
    font-weight: 500;
}

.sorting-section .block.date-block img:last-child {
    transition: transform 0.25s ease;
}

.sorting-section .block.date-block.active img:last-child {
    transform: rotate(180deg);
}

.calendar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    z-index: 20;

    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.calendar-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-4px);
}

.calendar-dropdown input {
    border: 1px solid #DADADA;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
}

.calendar-dropdown input:focus {
    border-color: #0B8E7A;
}

.generate-btn {
    background: #0B8E7A;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.generate-btn:hover {
    background: #07584C;
}


/* KPI меню */
.main-information {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 16px;
    padding: 15px;
    width: 100%;
}

.main-information h2 {
    font-size: 26px;
    font-weight: 600;
    color: #021814;
}

.main-information .container {
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
    width: 100%;
    padding-top: 15px;
}

.main-information .container .block {
    display: flex;
    align-items: center;
    padding: 10px;
    min-width: 0;
    border: 1px solid #07584C;
    border-radius: 12px;
    width: 25%;
}

.main-information .container .block img {
    width: 45px;
    height: 45px;
}

.main-information .container .block .text {
    margin-left: 15px;
}

.main-information .container .block .text p {
    color: #222222;
    font-size: 14px;
    font-weight: 400;
}

.main-information .container .block .text .value {
    font-size: 18px;
    font-weight: 600;
    padding-top: 5px;
}

/* Аналитика */
.analytics {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    width: 100%;
    gap: 10px;
}

.analytics h2 {
    font-size: 24px;
    font-weight: 600;
    color: #021814;
}

.analytics .block {
    background-color: white;
    border-radius: 16px;
    padding: 15px;

    container-type: inline-size;
}

.analytics .block .chart {
    background: #fff;
    border: 1px solid #0f6f5c;
    border-radius: 12px;
    padding: 15px;
    width: 100%;
    margin-top: 15px;
    flex: 1;
    min-height: 325px;
}

.analytics .block .chart h3 {
    color: #07584C;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.analytics .block .chart-wrapper {
    height: 200px;
    padding-top: 15px;

}

.analytics .block .legend {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.analytics .block .legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
}

.analytics .block .legend-item small {
    display: block;
    margin-top: 4px;
    font-weight: 600;
    font-size: 12px;
    color: #07584C;
}

.analytics .block .legend-item.mdl small {
    color: #FFC610;
}

.analytics .block .dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.analytics .block .dot.mdl {
    background: #FFC610;
}

.analytics .block .dot.eur {
    background: #07584C;
}

.analytics .block .legend-item-label {
    color: #222222;
    font-size: 15px;
    font-weight: 400;
}


/* Статистика по трафику */
.chart-trafic {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: space-around;
    border: 1px solid #0B6B5A;
    border-radius: 20px;
    padding: 15px;
    margin-top: 15px;
    height: 325px;
    container-type: inline-size;
}

.chart-trafic-canvas {
    width: 260px;
    height: 260px;
}

.chart-trafic-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.legend-trafic-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

.dot-trafic {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: 4px;
}

.title-trafic {
    font-size: 16px;
    font-weight: 500;
    color: #1C1C1C;
}

.value-trafic {
    font-size: 14px;
    font-weight: 500;
}

.legend-trafic-wide {
    grid-column: 1 / -1;
}

.legend-trafic-wide .title-trafic {
    max-width: 100%;
    line-height: 1.3;
}

/* Цвета */
.google-trafic .dot-trafic {
    background: #13C2A3;
}

.google-trafic .value-trafic {
    color: #13C2A3;
}

.tv-trafic .dot-trafic {
    background: #8FE3B1;
}

.tv-trafic .value-trafic {
    color: #8FE3B1;
}

.facebook-trafic .dot-trafic {
    background: #F4A3FF;
}

.facebook-trafic .value-trafic {
    color: #F4A3FF;
}

.outdoor-trafic .dot-trafic {
    background: #FFA24C;
}

.outdoor-trafic .value-trafic {
    color: #FFA24C;
}

.instagram-trafic .dot-trafic {
    background: #FF7A6E;
}

.instagram-trafic .value-trafic {
    color: #FF7A6E;
}

.referral-trafic .dot-trafic {
    background: #B8AEFF;
}

.referral-trafic .value-trafic {
    color: #B8AEFF;
}

.tiktok-trafic .dot-trafic {
    background: #9BC7FF;
}

.tiktok-trafic .value-trafic {
    color: #9BC7FF;
}


@container (max-width: 576px) {
    .chart-trafic {
        flex-direction: column;
        height: auto;
        align-items: flex-start;
        gap: 20px;
    }

    .chart-trafic-canvas {
        margin: 0 auto;
    }

    .chart-trafic-legend {
        grid-template-columns: 1fr 2fr;
        width: 100%;
        margin-left: 100px;
    }

    .legend-trafic-wide {
        margin-left: 60px;
    }
}

/* Пол */
.chart-sex {
    position: relative;
    padding: 20px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    text-align: center;
    margin-top: 15px;
    height: 325px;
}

.chart-sex__canvas-wrap {
    width: 190px;
    height: 220px;
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#genderChartSex {
    width: 190px !important;
    height: 190px !important;
}

.chart-sex__legend {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.chart-sex__legend-item {
    font-size: 14px;
    line-height: 1.3;
}

.chart-sex__legend-item span {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
}

.chart-sex__legend-item small {
    display: block;
    margin-top: 2px;
    font-weight: 500;
}

.pink-sex span {
    background: #f9a8d4;
}

.blue-sex span {
    background: #93c5fd;
}

.pink-sex small {
    color: #f472b6;
}

.blue-sex small {
    color: #60a5fa;
}
