html, body{
    height:100%;
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    background:#f3f3f3;
    overflow-x: hidden;
     scrollbar-width: none;    /* Firefox */
    -ms-overflow-style: none;
        user-select: none !important;
}

body::-webkit-scrollbar {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 610px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-layout {
    display: flex;
    align-items: flex-start;
}

/* CARD */
.card{
    background:white;
    border-radius:10px;
    box-shadow:0 2px 8px rgba(0,0,0,.12);
    overflow:hidden;
    flex-shrink: 0;
}

/* HEADER */
.header{
    display:flex;
    align-items:center;
    padding:14px 16px;
    cursor:pointer;
    user-select:none;
}

.code{
    width:15%;
    max-width: 160px;
    font-weight:bold;
    font-size:20px;
}

.progress-area{
    flex:1;
    display:flex;
    align-items:center;
    gap:10px;
}

/* GLOBAL BAR */
.bar{
    height:12px;
    background:#ddd;
    border-radius:10px;
    overflow:hidden;
    display:flex;
    width: 98%;
}

.bar-filled{
    display:flex;
}

.percent{
    width:55px;
    text-align:right;
    font-weight:bold;
    font-size:13px;
}

.arrow{
    width:30px;
    text-align:center;
}

/* DETAILS */
.details{
    display:none;
    padding:14px 16px;
    border-top:1px solid #eee;
}

.card.open .details{
    display:block;
}

/* SET LIST */
.set-list{
    display:flex;
    flex-direction:column;
    width: 100%;
}

.set-row{
    display:flex;
    align-items:flex-start;
    cursor: pointer;
    flex-wrap:wrap;
    justify-content:space-between;
    width:90%;
    padding: 5px 20px;
    height: 40px;
}

.set-list > .set-row:nth-child(odd) {
    background-color: #ffffff;
}

.set-list > .set-row:nth-child(even) {
    background-color: #f5f5f5;
}

.set-name{
    min-width:200px;
    font-size:15px;
    color:#333;
    margin-right: 10px;
    margin-top: 5px;
    margin-bottom: 5px;
    display: flex;
    align-items: end;
}

.set-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;   /* 👈 barra grigia piena */
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.set-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.set-fill{
    height:100%;
    transition:0.3s;
}

.set-percent{
    width:50px;
    text-align:right;
    font-size:12px;
    font-weight:bold;
}

.segment {
    height: 100%;   /* 👈 FONDAMENTALE */
    transition: width 0.3s ease;
}

.set-segment {
    height: 100%;  /* 👈 FONDAMENTALE */
}

.layout{
    display:flex;
    min-height: 100dvh; /* fondamentale */
    align-items: stretch; /* forza altezza uguale */
        height:100dvh;
    overflow-y:auto;
    overflow-x: hidden;
}

#dashboard{
    width:280px;
    background:white;
    padding:20px;
    box-shadow:0 2px 8px rgba(0,0,0,.1);

    position: sticky;
    top: 0;
    bottom: 0;

    height: auto;   /* 🔥 QUESTO è quello giusto */

    z-index: 9999;
}

#container{
    flex:1;
        margin: 0px 30px;
        padding-top: 30px;
        padding-bottom: 30px;
    display:flex;
    flex-direction:column;
    gap:12px;
    overflow-y:auto;
             scrollbar-width: none;    /* Firefox */
    -ms-overflow-style: none;

}

#container::-webkit-scrollbar {
    display: none;
}

.right {
    display:flex;
    flex-direction:column;
    flex:1;
    min-width:220px;
    width:100%;
}

.status-alert {
    display: flex;
    align-items: center;
    margin-top: 4px;
    font-size: 12px;
    color: #3498db;
}

.details-box {
    display: none;
    margin-top: 10px;
    width: 100%;
}

.set-list-row-detail-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 0px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
}

.timeline-item-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
}

.timeline-item-circle-incompleted {
    background: transparent;
    border: 2px solid #bdc3c7;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 4px;
}

.timeline-item-connector {
    position: absolute;
    left: 4px;
    top: 14px;
    width: 2px;
    height: 26px;
    background: #bdc3c7;
}

.timeline-item-content {
    display: flex;
    flex-direction: column;
}

.timeline-item-content-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.set-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.set-open-btn {
    margin-left: 25px;
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    background: #3498db;
    color: white;
    cursor: pointer;
    font-size: 12px;
}

.set-open-btn:hover {
    background: #2980b9;
}

.set-spec-chip {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
    margin-left: 10px;
}

.stats-panel {
    min-width: 250px;
    max-width: 400px;
    padding: 10px;
}

.message-text-dot {
    color: gray;
    margin: 0px 5px;
}

/* MOBILE */
@media (max-width: 700px) {
    .modal-layout {
        flex-direction: column;
    }

    .layout{
        flex-direction:column;
        overflow-y: auto;
    }

    #dashboard{
        width:100%;
        position:static;
    }

    #container{
        padding-top: 20px;
        padding-bottom: 20px;
            margin:0px 20px;
                    overflow-y: auto;

    }

    .stats-panel {
        border-right: none;
        margin-right: 0;
        margin-bottom: 20px;
        width: 100%;
        padding: 0px !important;
        margin-left: 5px;
    }

    .set-open-btn {
        display: none;
    }

    .set-row {
        height: 70px;
    }

    .status-alert {
        flex-direction: column;
        align-items: baseline;
    }

    .message-text-dot {
        display: none;
    }

    .set-list-row-detail-wrapper {
        margin-bottom: auto;
    }

    .set-name {
        margin-top: auto;
    }
    
    .stat {
        display: flex;
        gap: 10px;
    }

    .value {
        margin: 0px !important;
        font-size: 18px !important;
    }

    .label {
        align-self: center;
    }

    .left-stats {
        padding: 0px !important;
        margin-left: 12px;
        margin-top: 5px;
        gap: 6px !important;
    }

    .in-stats-row {
        display: flex;
        gap: 10px;
        margin-bottom: 5px !important;
    }

    .in-stats-title {
        align-self: center;
    }

    .in-stats-value {
        font-size: 16px !important;
    }
}

.in-stats-row {
    margin-bottom: 10px;
}

.in-stats-title {
    font-size: 12px;
    color: #888;
}

.in-stats-value {
    font-weight: bold;
}

.left-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.left-stats .label {
    font-size: 12px;
    color: #888;
}

.left-stats .value {
    margin-top: 5px;
    font-size: 20px;
    font-weight: bold;
}

.stat-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-text {
    font-size: 16px;
    color: #3d3d3d;
    margin-bottom: 2px;
}

.logo-full {
width: 90%;
max-width: 280px;
    object-fit: contain;
    margin-bottom: 15px;
}