/* =========================================
   RESPONSIVE
   ========================================= */
@media screen and (max-width: 768px) {

    #container {
        width: calc(100% - 20px);
        margin: 10px;
        float: none;
        margin-top: 20px;
    }

    .box {
        width: 100%;
        float: none;
        padding: 12px;
        margin: 0 0 12px 0;
        background-color: white;
        border-radius: 8px;
        clear: both;
        box-sizing: border-box;
    }

    .box::after {
        content: "";
        display: block;
        clear: both;
    }

    #div_login {
        width: 100%;
        margin: 0 auto;
    }
    
     .nav_bar {
        display: flex !important;
        background-color: var(--color-menu) !important; /* 🔥 colore giusto */
    }

    .menu {
        display: block;
        width: 100%;
        background-color: var(--color-menu) !important; /* 🔥 colore giusto */
    }

    .menu li {
        display: block;
        width: 100%;
        text-align: left;
        background-color: var(--color-menu) !important;
    }

    .menu a {
        background-color: var(--color-menu) !important;
        color: #fff !important; /* testo bianco OK perché sfondo è blu */
        border-bottom: 1px solid var(--color-menu-item);
        text-align: left;
    }

    .menu a:hover {
        background-color: var(--color-menu-item) !important;
        color: #fff !important;
    }

    /* SUBMENU */
    .submenu {
        position: static;
        display: none;
        width: 100%;
        background-color: var(--color-menu) !important;
        box-shadow: none;
        border: 0;
    }

    .submenu a {
        background-color: var(--color-menu-item) !important;
        color: #fff !important;
        padding-left: 20px;
    }

    .submenu a:hover {
        background-color: var(--color-menu-item) !important;
        opacity: 0.9;
    }

    .menu li:hover > .submenu,
    .menu li.aperto > .submenu {
        display: block;
    }
    

    .width-20,
    .width-25,
    .width-33,
    .width-40,
    .width-50,
    .width-60,
    .width-66 {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        padding-right: 0 !important;
    }

    #popup {
        width: calc(100% - 20px);
        margin: 10px;
        margin-top: 70px;
        box-sizing: border-box;
    }
    
   
    .search_input {
        width: calc(100% - 55px);
        box-sizing: border-box;
    }

    .select {
        width: 100%;
        max-width: 100%;
        margin: 10px 0;
        float: none;
        box-sizing: border-box;
    }

    #option {
        background-color: white;
        width: 100%;
        padding: 12px;
        margin: 0 0 12px 0;
        clear: both;
        float: none;
        display: block;
        box-sizing: border-box;
        border-radius: 8px;
    }
    
    .tabella {
    width: 100%;
    min-width: 100%;
    border: 0;
    box-shadow: none;
    background: transparent;
    border-collapse: collapse;
}

.tabella thead {
    display: none;
}

.tabella tbody,
.tabella tr,
.tabella td {
    display: block;
    width: 100%;
}

.tabella tr {
    margin-bottom: 12px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    padding: 8px 0;
}

.tabella td {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #edf2f7;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    text-align: left;
}

.tabella td:last-child {
    border-bottom: 0;
}

/* Etichetta solo se data-label esiste ed è valorizzato */
.tabella td[data-label]:not([data-label=""])::before {
    content: attr(data-label);
    display: block;
    padding: 8px 10px;
    border-left: 3px solid #eee;
    background-color: #eee;
    color: #444;
    font-weight: normal;
    text-align: left;
    flex: 0 0 42%;
    max-width: 42%;
    box-sizing: border-box;
}

/* Nessuna etichetta se manca o è vuoto */
.tabella td:not([data-label])::before,
.tabella td[data-label=""]::before {
    content: none;
    display: none;
}

/* Contenuto sempre a sinistra */
.tabella td > * {
    flex: 1 1 auto;
    max-width: 100%;
    text-align: left !important;
    margin: 0;
    box-sizing: border-box;
}

/* Elementi form e pulsanti */
.tabella td input,
.tabella td select,
.tabella td textarea,
.tabella td .pulsante_tabella,
.tabella td .pulsante_tabella_small,
.tabella td .tag_tabella,
.tabella td span,
.tabella td div,
.tabella td a,
.tabella td button {
    max-width: 100%;
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Se non c'è label, il contenuto occupa tutta la riga */
.tabella td:not([data-label]) > *,
.tabella td[data-label=""] > * {
    flex: 1 1 100%;
    max-width: 100%;
}
   

}