/**
 * Blocchi: fedelta' non attiva
 *
 * Stava dentro dashboard.php, in un blocco <style> in mezzo al markup.
 * Spegne le voci del menu quando manca qualcosa, e disegna l'avviso che lo dice.
 *
 * Il blocco del profilo da completare e' stato tolto il 31/07/2026 insieme al
 * passaggio obbligato: il profilo lo compila Nosu al colloquio iniziale.
 *
 * SI CARICA NELLO STESSO IDENTICO PUNTO in cui stava il blocco. Non e' un
 * dettaglio: nel CSS a parita' di specificita' vince chi arriva dopo, e queste
 * regole erano scritte per sovrascrivere quelle dei fogli caricati sopra.
 * Spostarle piu' in alto ne farebbe smettere di funzionare una parte, in modo
 * sparso e difficile da collegare alla causa.
 */

/* L'avviso di chi apre una sezione che non e' sua. Lo crea boot.js al volo:
   compare solo per i sotto-account, e quasi mai. */
#nsmAvvisoPermesso {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: #1A2E1A; color: #fff; padding: 12px 20px; border-radius: 12px;
    font-size: 13px; font-weight: 600; z-index: 10001; max-width: 90vw;
    text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,.2);
    transition: transform .25s ease;
}
#nsmAvvisoPermesso.show { transform: translateX(-50%) translateY(0); }
.nsm-fid-nav-available .nav-item { opacity: 1; }
.nsm-fid-nav-locked .nav-item-locked { display: flex; align-items: center; gap: 8px; opacity: 0.72; }
.nsm-fid-nav-locked .nav-item-locked:hover { opacity: 0.92; }
.nsm-fid-nav-locked .nav-item-label { flex: 1; min-width: 0; }
.nsm-fid-nav-unlock { font-size: 10px; font-weight: 700; color: #A5D6A7; text-transform: lowercase; letter-spacing: 0.02em; flex-shrink: 0; opacity: 0.95; }
.nsm-fid-nav-divider { height: 1px; background: rgba(255,255,255,0.10); margin: 10px 8px 12px; }
.mob-drawer-item-locked { opacity: 0.78; }
.mob-drawer-unlock { font-size: 10px; font-weight: 700; color: var(--mt-purple); text-transform: lowercase; flex-shrink: 0; margin-left: auto; }
body.automation-editor-only .sidebar,
body.automation-editor-only .topbar,
body.automation-editor-only .mob-page-tabs,
body.automation-editor-only .bg-scene { display: none !important; }
body.automation-editor-only .main-area,
body.automation-editor-only .views-container,
body.automation-editor-only #view-automations { padding: 0 !important; margin: 0 !important; max-width: 100% !important; }
body.automation-editor-only #view-automations > div:first-child { border-radius: 0 !important; border: none !important; box-shadow: none !important; padding: 8px !important; }
body.automation-editor-only #automation-flow-editor {
    inset: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    max-height: 100vh !important;
    padding: 10px !important;
}
#automation-flow-workspace {
    display: flex;
    flex-direction: row;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}
#automation-flow-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    position: relative;
}
#automation-flow-layout {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
#automation-flow-canvas-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
}
#automation-flow-canvas-wrap {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 420px;
    max-height: 58vh;
    overflow: auto;
    overscroll-behavior: contain;
}
#automation-flow-sidepanel {
    width: 320px;
    max-width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
}
#automation-flow-briefing-panel {
    display: none;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(157, 196, 157, .45);
    border-radius: 12px;
    background: linear-gradient(165deg, rgba(255,255,255,.97), rgba(241,250,241,.94));
    box-shadow: 0 10px 28px rgba(26,46,26,.08), inset 0 1px 0 rgba(255,255,255,.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
    flex: 0 0 auto;
    flex-shrink: 0;
    min-height: 0;
    z-index: auto;
    overflow: hidden;
}
#automation-flow-briefing-panel.nsm-wf-briefing-active {
    display: flex;
}
#automation-flow-briefing-panel .nsm-wf-briefing-sticky-zone {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px 12px;
    background: linear-gradient(165deg, rgba(255,255,255,.99), rgba(241,250,241,.97));
    border-bottom: 1px solid rgba(157, 196, 157, .32);
    box-shadow: 0 4px 14px rgba(26,46,26,.06);
}
#automation-flow-briefing-panel .nsm-wf-briefing-scroll-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 14px 12px;
    -webkit-overflow-scrolling: touch;
}
#automation-flow-briefing-panel:not(.nsm-wf-model-open) .nsm-wf-briefing-scroll-body {
    display: none;
    padding: 0;
    max-height: 0;
    overflow: hidden;
}
#automation-flow-briefing-panel:not(.nsm-wf-model-open) .nsm-wf-briefing-sticky-zone {
    border-bottom: none;
    box-shadow: none;
}
#automation-flow-briefing-panel.nsm-wf-model-open:not(.nsm-wf-model-expanded) {
    max-height: min(40vh, 300px);
}
#automation-flow-briefing-panel.nsm-wf-model-open:not(.nsm-wf-model-expanded) .nsm-wf-briefing-scroll-body {
    max-height: min(28vh, 220px);
}
#automation-flow-briefing-panel.nsm-wf-model-expanded {
    position: absolute;
    inset: 0;
    z-index: 30;
    margin: 0;
    border-radius: 12px;
    max-height: none;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(26,46,26,.18), inset 0 1px 0 rgba(255,255,255,.85);
}
#automation-flow-briefing-panel.nsm-wf-model-expanded .nsm-wf-briefing-scroll-body {
    max-height: none;
    flex: 1 1 auto;
}
#automation-flow-layout.nsm-wf-editor-dimmed {
    opacity: .35;
    pointer-events: none;
}
#automation-flow-briefing-panel .nsm-wf-briefing-toggle-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    margin: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(240,253,244,.98), rgba(220,252,231,.92));
    border: 1px solid rgba(130,182,130,.45);
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 800;
    color: #14532d;
    flex-shrink: 0;
}
#automation-flow-briefing-panel .nsm-wf-briefing-toggle-bar__hint {
    font-size: 10px;
    font-weight: 600;
    color: #6B8F6B;
}
#automation-flow-briefing-panel .nsm-wf-briefing-toggle-chevron {
    font-size: 14px;
    color: #2E7D32;
    transition: transform .2s ease;
}
#automation-flow-briefing-panel.nsm-wf-model-expanded .nsm-wf-briefing-toggle-chevron {
    transform: rotate(180deg);
}
#automation-flow-briefing-panel .nsm-wf-info-urls-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#automation-flow-briefing-panel .nsm-wf-info-url-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
#automation-flow-briefing-panel .nsm-wf-info-url-row input {
    flex: 1;
    min-width: 0;
}
#automation-flow-briefing-panel .nsm-wf-btn-add-link {
    align-self: flex-start;
    padding: 6px 10px;
    border: 1px dashed rgba(130,182,130,.55);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #2E7D32;
    background: rgba(255,255,255,.7);
    cursor: pointer;
    font-family: inherit;
}
#automation-flow-briefing-panel .nsm-wf-info-url-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: 1px solid #FECACA;
    border-radius: 8px;
    background: #FEF2F2;
    color: #B91C1C;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}
#automation-flow-briefing-panel .nsm-wf-file-hidden {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}
#automation-flow-editor.nsm-wf-editor-active #automation-flow-workspace {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
#automation-flow-editor.nsm-wf-editor-active .nsm-wf-editor-footer {
    flex-shrink: 0;
}
#automation-flow-editor.nsm-wf-editor-active .nsm-wf-editor-header {
    flex-shrink: 0;
}
#automation-flow-briefing-panel .nsm-wf-model-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
#automation-flow-briefing-panel .nsm-wf-model-select {
    flex: 1 1 200px;
    min-width: 160px;
    padding: 9px 10px;
    border: 1px solid rgba(130,182,130,.38);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #173617;
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(236,248,236,.72));
    font-family: inherit;
}
#automation-flow-briefing-panel .nsm-wf-model-btn-new {
    flex-shrink: 0;
    padding: 9px 14px;
    border: 1px solid rgba(130,182,130,.38);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #1A2E1A;
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(236,248,236,.75));
    cursor: pointer;
    font-family: inherit;
}
#automation-flow-briefing-panel .nsm-wf-model-details {
    display: none;
    flex-direction: column;
    gap: 10px;
}
#automation-flow-briefing-panel.nsm-wf-model-open .nsm-wf-model-details {
    display: flex;
}
#automation-flow-briefing-panel #wf-model-name,
#automation-flow-briefing-panel #wf-model-tone {
    padding: 9px 10px;
    border: 1px solid rgba(130,182,130,.38);
    border-radius: 8px;
    font-size: 12px;
    color: #173617;
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(236,248,236,.72));
    font-family: inherit;
}
#automation-flow-briefing-panel .nsm-wf-model-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}
#automation-flow-briefing-panel .nsm-wf-model-btn-save {
    padding: 8px 14px;
    border: 1px solid rgba(130,182,130,.45);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    background: #fff;
    color: #1A2E1A;
    cursor: pointer;
    font-family: inherit;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__badge {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #14532d;
    background: linear-gradient(135deg, rgba(240,253,244,.98), rgba(220,252,231,.9));
    border: 1px solid rgba(130,182,130,.45);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__title {
    font-size: 13px;
    font-weight: 800;
    color: #173617;
    letter-spacing: -0.02em;
    line-height: 1.25;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__sub {
    margin-top: 3px;
    font-size: 11px;
    color: rgba(23,54,23,.68);
    line-height: 1.4;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 0.9fr;
    gap: 8px 10px;
    align-items: end;
    padding: 10px;
    border: 1px solid rgba(130,182,130,.32);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,.88), rgba(236,248,236,.55));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid .nsm-wf-brief-span-full {
    grid-column: 1 / -1;
}
#automation-flow-briefing-panel .nsm-wf-briefing-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#automation-flow-briefing-panel .nsm-wf-briefing-section__label {
    font-size: 10px;
    font-weight: 800;
    color: #2E7D32;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #6B8F6B;
    min-width: 0;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid input,
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid textarea,
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid rgba(130,182,130,.38);
    border-radius: 8px;
    font-size: 12px;
    color: #173617;
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(236,248,236,.72));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 2px 8px rgba(46,125,50,.06);
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid input:focus,
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid textarea:focus,
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid select:focus {
    outline: none;
    border-color: rgba(46,125,50,.55);
    box-shadow: 0 0 0 3px rgba(76,175,80,.14), 0 6px 14px rgba(46,125,50,.1);
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid input::placeholder,
#automation-flow-briefing-panel .nsm-wf-briefing-banner__grid textarea::placeholder {
    color: rgba(107,143,107,.75);
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__assets {
    flex: 1 1 220px;
    min-width: 200px;
    padding: 10px 12px;
    border: 1px solid rgba(130,182,130,.35);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(236,248,236,.65));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__assets-title {
    font-size: 10px;
    font-weight: 800;
    color: #2E7D32;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__assets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__assets-row input[type="file"] {
    font-size: 11px;
    color: #5E7F5E;
    max-width: 100%;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__btn-upload {
    padding: 8px 12px;
    border: 1px solid rgba(130,182,130,.38);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #1A2E1A;
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(236,248,236,.75));
    cursor: pointer;
    font-family: inherit;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 4px 10px rgba(46,125,50,.08);
    transition: transform .12s ease, box-shadow .12s ease;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__btn-upload:hover {
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 6px 14px rgba(46,125,50,.12);
}
#automation-flow-briefing-panel #wf-asset-list {
    margin-top: 6px;
    font-size: 10px;
    color: #6B8F6B;
    line-height: 1.45;
}
#automation-flow-briefing-panel .nsm-wf-briefing-banner__actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
#automation-flow-briefing-panel #wf-generate-all-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    background: linear-gradient(135deg, #1f5f2e, #2e7d32);
    box-shadow: 0 10px 22px rgba(46,125,50,.28), inset 0 1px 0 rgba(255,255,255,.22);
    transition: transform .12s ease, box-shadow .12s ease;
}
#automation-flow-briefing-panel #wf-generate-all-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(46,125,50,.34), inset 0 1px 0 rgba(255,255,255,.28);
}
#automation-flow-briefing-panel #wf-generate-all-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}
#automation-flow-briefing-panel #wf-generate-progress {
    font-size: 11px;
    font-weight: 600;
    color: #2E7D32;
    padding-left: 2px;
}
@media (max-width: 1100px) {
    #automation-flow-briefing-panel .nsm-wf-briefing-banner__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    #automation-flow-briefing-panel .nsm-wf-briefing-banner__grid {
        grid-template-columns: 1fr;
    }
    #automation-flow-briefing-panel .nsm-wf-briefing-banner__actions {
        width: 100%;
    }
    #automation-flow-briefing-panel #wf-generate-all-btn {
        width: 100%;
    }
}
#automation-flow-editor.nsm-wf-editor-active {
    display: flex !important;
    flex-direction: column;
    overflow: hidden !important;
}
body.automation-editor-only #automation-flow-workspace {
    height: calc(100vh - 128px) !important;
}
body.automation-editor-only #automation-flow-canvas-wrap {
    max-height: none !important;
    height: 100% !important;
    min-height: 0 !important;
}
body.automation-editor-only #automation-flow-sidepanel {
    width: 340px !important;
    max-width: 340px !important;
    min-width: 340px !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: auto !important;
}
@media (max-width: 900px) {
    body.automation-editor-only #automation-flow-editor {
        padding: 8px !important;
    }
    body.automation-editor-only #automation-flow-layout {
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(320px, 56vh) minmax(220px, 36vh) !important;
        height: calc(100vh - 118px) !important;
    }
    body.automation-editor-only #automation-flow-canvas-wrap,
    body.automation-editor-only #automation-flow-sidepanel {
        height: 100% !important;
        min-height: 0 !important;
    }
}
