/* --- 1. OVERRIDE CORE PER BIANCO TOTALE E STICKY FOOTER --- */
:root {
    --ins-body-bg: #ffffff !important;
    --ins-page-bg: #ffffff !important;
    --bs-body-bg: #ffffff !important;
}

html, body {
    /* ELIMINATO height: 100% e overflow-x: hidden CHE ROMPEVANO I CALCOLI DI SYNCFUSION */
    min-height: 100vh;
    background-color: #ffffff !important;
    margin: 0;
    padding: 0;
}

/* Struttura per tenere il footer sempre in fondo */
.page {
    display: flex;
    flex-direction: column;
    /*min-height: 100%;*/
    min-height: 100vh;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1; /* Occupa tutto lo spazio disponibile */
    background-color: #ffffff !important;
}

.page-body {
    flex: 1; /* Questo spinge il footer verso il basso */
    padding-top: 2rem !important;
}

.footer {
    margin-top: auto; /* Forza il footer a stare in fondo al wrapper */
    background-color: #ffffff !important;
    border-top: 1px solid rgba(101, 109, 119, 0.1) !important;
    padding: 1rem 0;
}

/* --- 2. LOGICA ORIGINALE BLAZOR (Dalla tua copia) --- */
app {
    position: relative;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
}

/* --- 3. TUTTI I TUOI OVERRIDE SYNCFUSION (Spostati dal MainLayout) --- */
.e-panel-header {
    background-color: rgb(231, 241, 255) !important;
    text-align: center;
}

.e-panel-content {
    text-align: center;
    margin-top: 10px;
}

.highlight-row {
    background-color: #f0f2f7 !important;
}

.e-treegrid .e-headercell {
    background-color: #E7F1FF !important;
    color: black !important;
    font-weight: bold !important;
}

div.e-toolbar-items {
    background-color: #E7F1FF !important;
}

.e-rowdragheader {
    background-color: #E7F1FF !important;
}

/* Nascondi comandi specifici come avevi nel layout */
.e-removeCommand .e-unboundcell .e-unboundcelldiv button.e-Editbutton,
.e-removeCommandDelete .e-unboundcell .e-unboundcelldiv button.e-Deletebutton,
.e-removeEye .e-unboundcell .e-unboundcelldiv button.e-Nonebutton {
    display: none;
}

.e-showEye .e-unboundcell .e-unboundcelldiv button.e-Nonebutton {
    display: inline;
}

/* --- 4. FIX NAVBAR SAFECORE --- */
.navbar {
    background-color: #f7f7f7 !important; /* Ripristinato il tuo grigio originale */
    border-bottom: 1px solid rgba(101, 109, 119, 0.1) !important;
    box-shadow: none !important;
}

.navbar-nav .nav-item.active .nav-link {
    color: #206bc4 !important;
    border-bottom: 2px solid #206bc4 !important;
    font-weight: 600 !important;
}


/* Allinea la Dropdown Syncfusion nella Navbar */
.custom-dropdown.e-input-group {
    border: none !important;
    background-color: transparent !important;
    min-width: 150px;
}

.custom-dropdown .e-input {
    font-weight: 600;
    color: #495057 !important;
}

/* --- 5. STILE PROFILO UTENTE (Hover Verde Inspinia) --- */

.user-profile-dropdown {
    transition: all 0.2s ease;
    padding: 5px 10px !important;
    border-radius: 4px;
}

    /* Quando passi il mouse, il nome diventa Verde Inspinia */
    .user-profile-dropdown:hover .user-name-label {
        color: #1ab394 !important;
    }

    .user-profile-dropdown:hover {
        background-color: rgba(26, 179, 148, 0.05) !important;
    }

/* Stile per gli elementi del dropdown */
.dropdown-menu {
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

.dropdown-item {
    border-radius: 4px;
    padding: 0.6rem 1rem;
    font-size: 13px;
    transition: all 0.2s;
}

    /* Hover Standard (Verde) */
    .dropdown-item:hover {
        background-color: #1ab394 !important;
        color: #ffffff !important;
    }

    /* Hover Logout (Rosso Inspinia) */
    .dropdown-item.text-danger:hover {
        background-color: #ed5565 !important;
        color: #ffffff !important;
    }
/* --- 6. FIX POPUP SYNCFUSION PULITO --- */

/* Alziamo solo il livello per battere le modali di Bootstrap, senza toccare l'overflow */
.e-dropdown-popup,
.e-timepicker-popup,
.e-datepicker-popup {
    z-index: 999999 !important;
}


/* --- 7. RIPRISTINO STILI BOTTONI YES/NO (ADD ITEM) --- */

/*.new-item-content {
    display: flex;
    align-items: center;
}

.new-item-text {
    color: #495057;*/ /* Grigio scuro elegante */
/*}

.new-item-icon {
    cursor: pointer;
    color: #206bc4;
}*/

/* Il bottone carino */
/*.box-icon {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #206bc4;
    border-radius: 4px;
    color: #206bc4;
    text-align: center;
    min-width: 50px;
    background-color: #f0f6fc;*/ /* Azzurrino chiarissimo */
    /*font-style: normal;*/ /* Evita che SfIcon lo metta in corsivo */
    /*font-weight: 600;
    margin-left: 8px;
    transition: all 0.2s ease-in-out;
}

    .box-icon:hover {
        background-color: #206bc4;
        color: #ffffff !important;
        border-color: #206bc4;
    }*/

/* Rimuove lo sfondo dai singoli contenitori degli item della toolbar */
.sf-grid .e-toolbar div.e-toolbar-item {
    background: transparent !important;
    border: none !important;
}

/* --- 9. FIX DEFINITIVO: TOOLBAR AZZURRE E TAB BIANCHI --- */

/* 1. Ripristiniamo l'azzurrino SOLO nelle toolbar delle GRIGLIE */
.e-grid .e-toolbar,
.e-grid .e-toolbar-items {
    background-color: #E7F1FF !important;
    border-bottom: 1px solid #d1e3ff !important;
}

/* 2. Forziamo i TAB a rimanere BIANCHI (come SafeCore) */
.e-tab .e-tab-header,
.e-tab .e-toolbar-items {
    background-color: #ffffff !important;
}

/* 3. Evidenziamo il TAB SELEZIONATO (Sfondo bianco e bordo blu) */
.e-tab .e-toolbar-item.e-active .e-tab-wrap {
    background-color: #E7F1FF !important;
    border-bottom: 2px solid #206bc4 !important;
}

/* 4. BOTTONI TOOLBAR: Senza sfondo (trasparenza) e con hover azzurro */
.e-toolbar .e-tbar-btn,
.e-toolbar .e-btn {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

    .e-toolbar .e-tbar-btn:hover {
        background-color: #bcd9ff !important; /* Azzurro più scuro all'hover */
        color: #0056b3 !important;
        border-radius: 4px;
    }


/* --- 10. STILE TIMELINE (FormCompile) --- */
.custom-timeline {
    padding: 5px 0 !important;
    background: transparent !important;
    width: 100%;
    overflow-x: auto;
}

    /* FORZA LA TIMELINE IN ORIZZONTALE E NASCONDE I NUMERI DI FALLBACK HTML */
    .custom-timeline .e-timeline-items {
        display: flex !important;
        flex-direction: row !important;
        width: max-content !important; /* Impedisce di andare a capo, permette lo scroll */
        padding: 15px 0 !important;
        list-style-type: none !important; /* Rimuove i numeri 1. 2. */
        margin: 0;
    }

    .custom-timeline .e-timeline-item {
        flex: 0 0 auto !important; /* Mantiene la larghezza fissa degli elementi */
        width: auto !important;
        margin-right: 15px;
    }

        .custom-timeline .e-timeline-item::before {
            display: none !important; /* Rimuove marker HTML indesiderati */
        }


    /* Contenitore del singolo step */
    .template-container {
        cursor: pointer;
        padding: 10px 15px;
        border-radius: 8px;
        transition: all 0.2s ease;
        min-width: 180px;
        text-align: center;
        position: relative;
        background: #ffffff;
        border: 1px solid #e2e8f0 !important; /* Bordo sottile invece di 5px solid */
    }
        /* Stato: Selezionato (Blu SafeCore) */
        .template-container.item-Selected {
            background: #f0f7ff;
            border-color: #206bc4 !important;
            box-shadow: 0 4px 6px -1px rgba(32, 107, 196, 0.1);
        }

            .template-container.item-Selected .timeline-content {
                color: #206bc4;
                font-weight: 600;
            }
    /* Testo dentro la timeline */
    .timeline-content {
        font-size: 12px;
        line-height: 1.4;
        color: #64748b;
    }
    /* Linea di progresso e indicatori */
    .progress-line {
        height: 4px;
        background: #e2e8f0;
        position: absolute;
        bottom: -15px;
        left: 0;
        right: 0;
    }

    .indicator {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #cbd5e1;
        display: inline-block;
        position: absolute;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
    }

    .item-Selected .indicator {
        background: #206bc4;
        box-shadow: 0 0 0 4px rgba(32, 107, 196, 0.2);
    }
    /* --- 11. EVIDENZIAZIONE STORICA (Solo per la Timeline) --- */
    /* Stile per i frammenti storici selezionati (Azzurro Timeline) */
    .timeline-diff-highlight {
        /* Sfondo azzurro chiarissimo (stile info/light blue) */
        background-color: #f0f8ff !important;
        /* Bordo laterale azzurro acceso (coordinato con la timeline) */
        border-left: 4px solid #0d6efd !important;
        padding: 10px;
        border-radius: 4px;
    }
        /* Modifica del testo in inglese e colore azzurro */
        .timeline-diff-highlight::before {
            /*content: "VALUE IN SELECTED FRAGMENT";*/
            color: #0d6efd; /* Testo azzurro per richiamare il bordo */
            font-size: 0.75rem;
            font-weight: 800;
            text-transform: uppercase;
            display: block;
            margin-bottom: 8px;
        }
    /* ======================================================
MEMO PER IL FUTURO (Non cancellare):
Colori Giallo/Warning da usare per i Validators:
Background: #fff3cd
Border/Text: #ffc107 o #856404
======================================================
*/
    /* --- AGGIUNGI QUESTO IN FONDO AL FILE PER L'ERRORE BLAZOR --- */

    #blazor-error-ui {
        background: #fff3cd; /* Giallo chiaro classico */
        bottom: 0;
        box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1);
        display: none; /* NASCOSTO DI DEFAULT */
        left: 0;
        padding: 0.6rem 1.25rem 0.7rem 1.25rem;
        position: fixed; /* Sta sopra a tutto solo quando serve */
        width: 100%;
        z-index: 9999;
        color: #856404;
        border-top: 1px solid #ffeeba;
    }

        #blazor-error-ui .dismiss {
            cursor: pointer;
            position: absolute;
            right: 0.75rem;
            top: 0.5rem;
        }