/* === FASCIONE SUPERIORE (HEADER) — COMUNE A TUTTI LABORATORI === */

#mainHeader {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 2000;
    padding: 5px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
    font-family: Arial, sans-serif;
}

.header-wrapper {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

#mainHeader h1 {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 600;
    color: white;
    border-bottom: none;
    padding-bottom: 0;
}

#mainHeader .subtitle {
    font-size: 14px;
    margin: 5px 0 0 0;
    opacity: 0.9;
    color: white;
}

/* CLASSI HEADER DESKTOP */
.saluto-mobile, .nome-mobile { display: inline !important; }
.header-layout { display: flex; justify-content: space-between; align-items: center; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.header-user-block { text-align: right; font-size: 12px; line-height: 1.3; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.header-separator { border-left: 1px solid #444; height: 30px; margin: 0 2px; }

/* Responsive header (max-width: 768px) */
@media screen and (max-width: 768px) {
    #mainHeader {
        position: sticky;
        top: 0;
        z-index: 2000;
    }

    #mainHeader .header-wrapper {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        padding: 8px 15px !important;
    }

    #mainHeader .header-actions {
        width: 100% !important;
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    #mainHeader .header-user-block {
        width: auto !important;
        align-items: flex-start !important;
        text-align: left !important;
        margin-bottom: 4px !important;
        order: 1 !important;
    }

    #mainHeader .header-separator {
        display: block !important;
        height: 20px !important;
        margin: 0 !important;
        order: 2 !important;
    }

    #btn-configurazione { order: 4 !important; }
    #mainHeader .header-actions > button:last-child { order: 5 !important; }

    #mainHeader .header-actions .btn {
        font-size: 10px !important;
        min-width: 85px !important;
        height: 24px !important;
        padding: 0 4px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

        #mainHeader .header-actions #btn-toggle-tema {
        order: 3 !important;
        min-width: 24px !important;
        max-width: 24px !important;
        width: 24px !important;
        height: 24px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

#btn-toggle-tema {
    font-size: 0;
    padding: 0.25rem 0.4rem;
}
#btn-toggle-tema::before {
    content: "🌓";
    font-size: 11px;
}

#btn-configurazione {
    font-size: 0;
}
#btn-configurazione::before {
    content: "⚙ Configurazione";
    font-size: 11px;
}

#mainHeader .header-actions > button:last-child {
    font-size: 0;
}
#mainHeader .header-actions > button:last-child::before {
    content: "Torna al Menù";
    font-size: 11px;
}