.suivi-container {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 95%;
    height: 80vh;
    margin: 0 auto;
}

.activite-infos {
    position: absolute;
    right: 20px;
    top: 0;
    transform: translateY(-100%);

    p {
        margin: 10px;
    }
}

.pro-stats-container, .stats-container {
    gap: 10px;
    width: calc(100% - 40px);
    max-height: 80vh;
    padding: 10px;
    background: var(--cts-main);
    border-radius: 10px;
    position: relative;
    box-shadow: var(--box-shadow);

    h2 {
        margin: 10px 0;
        padding: 5px 20px;
        position: sticky;
        top: 0;
        background: var(--blocks);
        font-size: 1em;
        z-index: 2;
    }
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
}

.pro-stats-container {
    display: flex;
    flex-direction: column;

    .summary {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 10px;
        min-width: fit-content;

        h2 {
            text-align: center;
            font-size: 1.5em;
        }

        .ca-summary {
            display: flex;
            width: 100%;
            height: 100%;
            box-sizing: border-box;
            flex-direction: column;
            border-radius: 5px;
            padding: 10px;
            background: var(--blocks);
            box-shadow: var(--box-shadow);

            strong {
                text-align: center;
                font-size: 2em;
            }

            .previous {
                border-top: 1px solid var(--cts-main);
                padding-top: 20px;
                margin: 10px auto;
                display: grid;
                grid-template-rows: repeat(2, 1fr);
                text-align: right;
                width: 100%;
                box-sizing: border-box;

                .row {
                    display: grid;
                    grid-template-columns: repeat(3, 1fr);
                    gap: 10px;

                    strong {
                        font-size: unset;
                    }
                }
            }
        }

        .pro-part-panel {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            border-radius: 5px;
            padding: 10px;
            height: 100%;
            background: var(--blocks);
            box-shadow: var(--box-shadow);

            .ca-pro-part {
                display: flex;
                flex-direction: row;
                gap: 5px;
                width: 100%;
                height: 100%;
                margin: 5px auto;

                .col-pro-part {
                    display: grid;
                    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
                    align-items: center;
                    gap: 5px;
                    width: 100%;
                    min-height: 0;

                    .metric {
                        display: flex;
                        flex-direction: column;
                        gap: 1px;
                        width: 100%;
                        height: 100%;
                        min-height: 0;

                        &.metric-top {
                            justify-content: flex-end;
                        }

                        &.metric-bottom {
                            justify-content: flex-start;
                        }
                    }

                    .col-part, .col-pro {
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        white-space: nowrap;
                        min-height: 20px;
                        color: var(--blocks);
                        width: 100%;
                        min-width: 100px;
                        position: relative;
                        overflow: hidden;
                        box-sizing: border-box;

                        .bar-label {
                            position: absolute;
                            inset: 0;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            padding: 0 5px;
                            font-size: .8em;
                            font-weight: 600;
                            line-height: 1;
                        }
                    }

                    .col-part {
                        background: var(--cts-main);
                    }

                    .col-pro {
                        background: var(--cts-alt);
                    }

                    .years {
                        padding: 5px 0;
                        font-weight: 600;
                        text-align: center;
                    }
                }
            }
        }
    }

    .table-wrapper {
        flex: 1;
        width: 100%;
        box-shadow: var(--box-shadow);
    }

    .table-pros {
        tbody tr:hover {
            filter: brightness(.9);
        }

        td {
            background: var(--blocks);
            text-align: center;

            &:first-child {
                white-space: wrap;
                text-align: left;
            }
        }

        .malus {
            background: #ff9797;
        }

        .bonus {
            background: #94e594;
        }
    }

    .decreased, .increased {
        font-weight: bold;
    }

    .decreased {
        color: red;
    }

    .increased {
        color: #12ba12;
    }
}

.stats-wrapper {
    width: 100%;
    border-radius: 5px;
    box-shadow: var(--box-shadow);
    padding: 0;
    background: var(--blocks);
    overflow: hidden;
    height: stretch;

    &:last-child {
        grid-column: 1 / -1;
    }
}

.stats-panel, .pro-stats-panel {
    width: 100%;
    height: calc(100% - 35px);
    overflow: auto;

    &.table-panel {
        height: calc(100% - 35px);
    }
}

.pro-stats-panel {
    min-height: fit-content;
    display: flex;
    gap: 10px;
}

.panel-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    width: calc(100% - 20px);
    min-height: 35px;
    padding: 0 10px;
    background: var(--blocks);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;

    &.bottom {
        border-bottom: none;
        border-top: 1px solid rgba(0, 0, 0, 0.12);
        bottom: 0;
    }

    .legende {
        display: flex;
        align-items: center;
        gap: 5px;

        .part, .pro {
            width: 10px;
            height: 10px;
            border-radius: 100%;
        }

        .part {
            background: var(--cts-main);
        }

        .pro {
            background: var(--cts-alt);
        }
    }
}

.panel-tools-title {
    margin-right: auto;
    font-size: .85em;
    font-weight: 600;
    opacity: .7;
}
