.drop-zone {
    height: 25px;
    transition: all 0.15s ease;
}

    .drop-zone.active-row {
        /*height: 20px;*/
        background: rgba(40, 167, 69, 0.25);
        border: 3px solid #28a745;
    }

        .drop-zone.active-row::after {
            content: "New line";
            font-size: 11px;
            color: #28a745;
        }

.drop-zone-item {
    height: 12px; /* Quasi invisibile di default */
    /*margin: -2px 0;*/ /* Sovrappone leggermente per non creare buchi nel layout */
    transition: all 0.2s ease-in-out;
    position: relative;
    z-index: 5;
    background: transparent;
}

    .drop-zone-item.active-item {
        height: 30px; /* Si espande per mostrare il messaggio */
        /*margin: 8px 0; */ /* Crea spazio reale tra i componenti */
        background: rgba(0, 123, 255, 0.25);
        border-top: 3px solid #007bff;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .drop-zone-item.active-item::after {
            content: "Insert item here";
            font-size: 12px;
            font-weight: bold;
            color: #007bff;
        }


.form-row-content {
    display: flex;
    width: 100%;
    min-width: 0;
    /*gap: 10px;*/
    align-items: stretch;
    /*cursor: grab;*/
    padding: 4px;
    /*padding: 10px 12px;*/ /* 👈 importantissimo */

    position: relative;
    /*padding-top: 25px;*/ /* Crea spazio per le etichette in alto senza rompere il layout */
    /*border: 2px dashed #ccc;*/
}

.form-item {
    padding: 10px;
    background: white;
    border: 1px solid #ccc;
    cursor: grab;
}

    .form-item.selected-fc {
        border: 2px solid #0d6efd;
        background: #e7f1ff;
    }

.form-cell {
    flex: 1;
    position: relative;
    min-height: 80px;
    border: 1px dashed #dcdcdc;
    background: #fafafa;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    /*padding-top: 0px !important;*/
    margin: 5px;
    padding-top: 5px !important; /* Crea spazio per le etichette in alto senza rompere il layout */
    /*margin-bottom: 15px;*/
}

.cell-highlight {
    background-color: rgba(0, 123, 255, 0.15) !important;
    border: 2px solid #007bff !important;
}

.form-cell, .form-item {
    min-width: 0; /* IMPORTANTE: permette al flex-item di rimpicciolirsi */
    max-width: 100%; /* Impedisce di uscire dal padre */
    overflow: hidden; /* Taglia ciò che esce, così la SfGrid attiva il suo scroll */
    padding: 5px 5px;
}

.drag-handle {
    position: absolute;
    height: 20px;
    padding: 0 8px;
    font-size: 12px;
    white-space: nowrap; /* Impedisce che il testo vada a capo */
    width: auto; /* Si stringe attorno al testo */
    z-index: 20;
    top: 0;
    z-index: 10;
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: grab;
    transition: transform 0.1s;
    user-select: none; /* Evita che il testo venga selezionato durante il drag */
}

    .drag-handle:active {
        cursor: grabbing;
    }


/*.form-row-wrapper {
    border: 2px dashed transparent;
    border-radius: 6px;*/
/*margin: 8px 0;*/ /* 👈 più spazio tra righe */
/*transition: all 0.2s ease;
}*/
/* Distinguiamo posizione riga e cella */
/*.drag-line-handle {
    left: 0;
}
.drag-cell-handle {
    left: 10px;
}*/

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* Sfondo grigio trasparente */
    z-index: 1000; /* Assicurati che sia sopra tutti gli altri elementi */
    pointer-events: all;
}

.designer-layout {
    display: flex;
    flex-wrap: nowrap; /* IMPORTANTISSIMO */
    width: 100%;
    height: auto;
    margin-top: 10px;
    min-width: 800px;
}
/* toolbox*/
.toolbox {
    flex: 0 0 220px; /* invece di width: 220px; */
    padding: 10px;
    background: #fff;
    position: sticky;
    top: 60px; /* distanza dal top mentre scrolli */
    align-self: flex-start; /* IMPORTANTISSIMO in flex */
}

.toolbox-item {
    padding: 8px;
    margin-bottom: 6px;
    background: #eee;
    border: 1px solid #ccc;
    cursor: grab;
}
/* AREA FORM */
.fd-canvas {
    flex: 1 1 auto;
    min-width: 500px; /* evita che collassi */
    /*flex: 1;
    min-width: 0; */
    background: rgb(244, 246, 249);
    padding: 10px;
    padding-top: 0px;
    /* position: relative; */
    transition: margin-right 0.3s;
    /* min-height: 800px; */ /* IMPORTANTISSIMO per property panel */
    overflow-y: auto;
    min-width: 0;
    width: 100%;
    overflow-x: auto;
}


/*.form-row-wrapper.drag-over {
        border-color: #4aa3ff;*/ /* blu leggero */
/*background: rgba(74, 163, 255, 0.08);
    }
    .form-row-wrapper.dragging {
        opacity: 0.6;
        background: rgba(0, 0, 0, 0.05);
        border-style: dashed;
    }
    .form-row-wrapper:hover {
        background: rgba(0, 0, 0, 0.03);
    }*/

/* Assicurati che il componente Syncfusion non venga compresso */
.e-grid {
    min-width: 100%;
}
/* AREA SIDEBAR*/
.property-panel {
    flex-shrink: 0;
    padding-left: 20px;
    padding-top: 0px;
    padding-bottom: 10px;
    position: sticky;
    top: 70px;
    align-self: flex-start;
    transition: width 0.25s ease;
}

    .property-panel * {
        box-sizing: border-box;
    }
    /* Sidebar chiusa */
    .property-panel.closed {
        /* width: 0;
        overflow: hidden;
        transition: width 0.25s ease;*/

        width: 10px;
        min-width: 10px;
        max-width: 10px;
        overflow: visible; /* non nascondere il toggle */
    }
    /* Sidebar aperta */
    .property-panel.open {
        /*flex: 0 0 300px; 
        transition: width 0.25s ease;
        background: #fff;*/
        /* border-left: 1px solid #ccc; */
        /*overflow-y: auto;*/
        width: 310px;
        min-width: 310px;
        max-width: 310px;
        min-height: 110px;
        background: white;
        overflow-y: auto;
        overflow-x: hidden; /* FIX */
        /*border-left: 1px solid #ddd;*/
    }

.panel-toggle {
    position: absolute;
    left: 0px;
    top: 0px;
    padding-top: 10px;
    width: 20px;
    height: 130px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}
/*.e-accordion .e-toggle-icon {
    display: none !important;
}*/
.no-toggle {
    pointer-events: none;
}

    .no-toggle .e-acrdn-header {
        pointer-events: none;
    }
/* freccia */
.toggle-arrow {
    font-size: 14px;
}
/* testo verticale */
.toggle-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 12px;
    font: bold;
    margin-top: 6px;
}
/* nascondi titolo quando aperto */
/*.property-panel.open .panel-title {
    display: none;
}*/
.prop-row {
    margin-bottom: 12px;
}

    .prop-row label {
        font-size: 12px;
        color: #555;
    }
/* AREA CELL */
.cell-wrapper {
    position: relative;
}
/*

.cell-highlight {
    animation: pulse 0.8s infinite alternate;
}

@keyframes pulse {
    from {
        box-shadow: inset 0 0 0 2px #007bff;
    }

    to {
        box-shadow: inset 0 0 0 6px rgba(0,123,255,0.3);
    }
}*/


.btn-icon-sm {
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1;
}

.e-draggrip-icon::before {
    font-family: "e-icons";
    content: '\e7d8';
}

.e-code-icon::before {
    font-family: "e-icons";
    content: '\E76D';
}

.full-signature {
    width: 100% !important;
    height: 100% !important;
}

.input-valid .e-input,
.input-valid input {
    border: 2px solid #28a745 !important;
}

.input-invalid .e-input,
.input-invalid input {
    border: 2px solid orange !important;
}


.image-wrapper {
    display: flex;
    justify-content: center; /* centro orizzontale */
    align-items: center; /* centro verticale */
    overflow: auto; /* scroll se immagine grande */
    margin-top: 15px;
    max-height: 600px; /* opzionale */
    border: 1px solid #ddd; /* opzionale */
}

    .image-wrapper img {
        display: block;
        max-width: none; /* IMPORTANTISSIMO */
        height: auto;
    }