﻿.table th {
    cursor: pointer;
    user-select: none;
}

.pagination {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .pagination button {
        margin: 0 5px;
        padding: 5px 10px;
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }

        .pagination button:disabled {
            background-color: #ccc;
            cursor: not-allowed;
        }

input[type="text"] {
    padding: 8px;
    width: 100%;
    max-width: 300px;
}

.centerText {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.Table1 {
    margin: 0 5px 0 5px;
    border: none;
}

    .Table1 td {
        border: solid 1px;
        padding: 5px;
    }

.FormDropDown {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    height: 100%;
    padding: 0.75rem .75rem;
    overflow: hidden;
    text-align: start;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    transform-origin: 0 0;
    display: inline-block;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: small;
}

.custom-bg-warning {
    background-color: #fffe91 !important;  /* colore bg-warning */
    color: #28a745 !important; /* verde Bootstrap standard */
}

/* Contenitore principale dell'albero delle entità: centra ogni livello */
.entity_treeview {
    padding-left: 1rem;
    font-family: Arial, sans-serif;
    width: 100%; /* occupa tutta la larghezza */
    white-space: nowrap; /* tiene gli inline-block sulla stessa linea */
    overflow-x: auto; /* scroll orizzontale */
    overflow-y: hidden; /* niente scroll verticale */
}

/* Nodo */
.entity_tree-node {
    display: inline-block;
    vertical-align: top;
    margin: 1rem;
    position: relative;
}

.entity_node-header {
    background: lightblue;
    border: 1px solid #ccc;
    padding: 0.5rem;
    box-sizing: border-box;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    position: relative;
    width: 230px;
    min-height: 170px;
    transition: background 0.3s;
    white-space: normal; /* ← permette i ritorni a capo */
    overflow-wrap: break-word; /* gestisce parole troppo lunghe */
    word-break: break-word; /* fallback per vecchi browser */
}

    /* entità selezionata */
    .entity_node-header.selected {
        /*background: #30F76A;*/
        /*border-color: #66bb6a;*/
        /*border: 4px solid red;*/
        /*box-shadow: 0 0 0 6px Background, 0 0 0 12px darkred; /* anello esterno */
        /*box-shadow: 1px 1px 15px 10px rgb(172, 7, 145);*/
        /*box-shadow: 1px 1px 15px 10px rgb(231, 237, 33);*/
        box-shadow: 1px 1px 15px 10px rgb(232, 89, 26);
        border-radius: 4px;
    }

    .entity_node-header.belongToEntityParamRule {
        box-shadow: 0 0 0 8px green; /* anello esterno */
        border-radius: 6px;
    }

.entity_node-content {
    display: flex;
    align-items: flex-start; /* allinea in alto */
    justify-content: flex-start; /* porta contenuti in cima */
    flex-direction: column;
    height: calc(100% - 1.5rem); /* lascia spazio al toggle in basso */
}

.entity_node-text {
    color: #072e63;
    word-wrap: break-word; /* <-- assicura il word wrap nei testi */
    overflow-wrap: break-word; /* <-- doppia copertura */
    white-space: normal;
    width: 100%; /* <-- il testo occupa tutta la larghezza disponibile */
}

    .entity_node-text strong {
        font-size: 1rem;
        color: #0a43e0;
    }

    .entity_node-text p {
        margin: 0;
        font-size: 0.875rem;
        color: #0a43e0;
    }

/* Collegamento verticale dal genitore solo se ci sono figli */
.entity_node-header.has-children::after {
    content: "";
    position: absolute;
    top: 100%; /* parte esattamente al bordo inferiore del nodo */
    left: 50%; /* centrazione orizzontale */
    transform: translateX(-50%);
    /* lunghezza uguale al margin-top del contenitore figli */
    height: 1rem;
    width: 2px;
    background: #ccc;
    z-index: 0;
}

/* Contenitore orizzontale dei figli */
.entity_node-children.horizontal {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap; /* niente a capo */
    /*overflow-x: auto;  scroll orizzontale se serve */
    position: relative; /* per posizionare il ::before */
    margin-top: 1rem;
    padding: 0 1rem;
}

    /* Linea orizzontale che unisce i figli */
    .entity_node-children.horizontal::before {
        content: "";
        position: absolute;
        top: 0; /* posiziona alla parte superiore del contenitore */
        left: 0;
        right: 0;
        height: 2px; /* spessore della linea */
        background: #ccc;
        z-index: -1; /* dietro ai nodi per non coprirli */
    }

    /* Collegamento verticale verso ogni figlio */
    .entity_node-children.horizontal > .entity_tree-node::before {
        content: "";
        position: absolute;
        top: -20px;
        left: 20%;
        transform: translateX(-20%);
        width: 2px;
        height: 20px;
        background: #ccc;
        display: block;
        z-index: 0;
    }

/* Toggle icon in basso a destra */
.toggle-icon {
    position: absolute;
    bottom: -7px;
    right: 2px;
    z-index: 1;
}

.toggle-container {
    position: absolute;
    bottom: -7px;
    width: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.toggle-text {
    font-size: 0.9rem;
    color: #333;
}

    .toggle-text.left {
        margin-right: 4px;
    }

    .toggle-text.right {
        margin-left: 4px;
    }

.overlayTKP {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinnerTKP {
    background: white;
    color: green;
    padding: 20px;
    border-radius: 5px;
    font-weight: bold;
    min-width: 180px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.loaderTKP {
    border: 6px solid #f3f3f3;
    border-top: 6px solid green;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.rounded-container {
    display: inline-block; /* si adatta al contenuto */
    padding: 1rem 1rem; /* spazio interno: regola a piacere */
    border: 1px solid #ccc; /* bordo sottile */
    border-radius: 0.5rem; /* angoli arrotondati */
    width: 100%;
}

.modal-no-header .modal-header {
    display: none !important;
}

.tree-root,
.tree-node-children {
    list-style-type: none;
    margin-left: 1rem;
    padding-left: 0;
}

.tree-node-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
}

.tree-toggle-icon {
    width: 1em;
    display: inline-block;
    margin-left: -1rem;
}

.tree-node-children .tree-node-header {
    margin-left: 1rem;
}

.attachmentHistoryColor1
{
    background-color: lightblue !important;
    color: darkslategrey !important;
}

.attachmentHistoryColor2 {
    background-color: lightskyblue !important;
    color: darkslategrey !important;
}

.table-width45 {
    width: 45px;
}

.table-grid-wrap td,
.table-grid-wrap th {
    white-space: normal; /* permette l'andata a capo */
    word-wrap: break-word; /* fallback vecchio */
    overflow-wrap: anywhere; /* spezza parole molto lunghe se necessario */
}
