* { 
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body { 
    overscroll-behavior-y: contain;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}
input, select, textarea { 
    font-size: 16px !important;
}
.compact-input {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}
.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s;
}
.step-indicator.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
}
.step-indicator.completed {
    background: #10b981;
    color: white;
}
.section-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
    transition: all 0.3s;
}
.section-card:hover {
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}
.product-pill {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: 2px solid;
    transition: all 0.3s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
.product-pill.selected {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
.brm-calculator {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem;
}
.brm-result {
    background: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-weight: bold;
    font-size: 0.875rem;
    color: #f59e0b;
    text-align: center;
    margin-top: 0.5rem;
}

/* 🎯 FASE 18A - STILI VALIDAZIONE */
.input-valid {
    border: 2px solid #10b981 !important;
    background: #f0fdf4 !important;
}
.input-warning {
    border: 2px solid #f59e0b !important;
    background: #fffbeb !important;
}
.input-error {
    border: 2px solid #ef4444 !important;
    background: #fef2f2 !important;
}
.validation-message {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.validation-message.error {
    color: #ef4444;
}
.validation-message.warning {
    color: #f59e0b;
}
.validation-message.success {
    color: #10b981;
}
/* 🛡️ OVERRIDE VALIDAZIONE MANUALE */
.input-overridden {
    border: 2px solid #10b981 !important;
    background: #f0fdf4 !important;
}
.validation-override-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 0.5rem;
}
.btn-override-confirm {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #10b981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 0.5rem;
    border: none;
    transition: all 0.2s;
}
.btn-override-confirm:hover {
    background: #059669;
    transform: scale(1.05);
}
.btn-override-cancel {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #6b7280;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    margin-left: 0.5rem;
    border: none;
    transition: all 0.2s;
}
.btn-override-cancel:hover {
    background: #4b5563;
    transform: scale(1.05);
}
.validation-summary {
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 1rem;
}
.pulse-error {
    animation: pulseRed 2s infinite;
}
@keyframes pulseRed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
.product-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s;
}
.product-card:hover {
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}
.tab-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s;
}
.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* ============================================
   🍔 MENU SISTEMA - FASE 021: MENU LATERALE
   ============================================ */

:root {
    --menu-primary: #2563eb;
    --menu-header-bg: #1e40af;
    --menu-bg: #f8fafc;
    --menu-hover: #e2e8f0;
    --menu-text: #1e293b;
    --menu-text-sec: #64748b;
    --menu-border: #cbd5e1;
    --menu-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Header fisso compatto */
.app-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--menu-header-bg);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 40;
    box-shadow: var(--menu-shadow);
}

/* Assicura che select/dropdown nativi siano sopra header */
select:focus {
    position: relative;
    z-index: 50;
}

/* Container principale con padding per non andare sotto header */
body {
    padding-top: 0;
}

.menu-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
    transition: transform 0.2s;
}

.menu-toggle:hover {
    transform: scale(1.1);
}

.app-title {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255,255,255,0.2);
}

/* 📎 v5.27: Icona schizzo disabilitata */
.btn-icon.btn-disabled {
    opacity: 0.4;
    cursor: default;
}
.btn-icon.btn-disabled:hover {
    background: rgba(255,255,255,0.1);
}
.btn-icon.btn-small {
    font-size: 14px;
    padding: 6px 8px;
    margin-left: -4px;
}

/* 🆕 v5.742: Container Schizzo con pulsante modifica */
.schizzo-container {
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-schizzo-edit {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-schizzo-edit:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

/* 🆕 v5.738: Pulsante Schizzo VISIBILE */
.btn-schizzo {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.btn-schizzo.has-schizzo {
    background: linear-gradient(135deg, #00c853 0%, #00e676 100%);
    border-color: #00e676;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 200, 83, 0.4);
    animation: pulse-schizzo 2s infinite;
}
.btn-schizzo.no-schizzo {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.6);
}
.btn-schizzo:hover {
    transform: scale(1.05);
}
.btn-schizzo.has-schizzo:hover {
    box-shadow: 0 4px 12px rgba(0, 200, 83, 0.6);
}
.btn-schizzo.no-schizzo:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    color: white;
}
@keyframes pulse-schizzo {
    0%, 100% { box-shadow: 0 2px 8px rgba(0, 200, 83, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(0, 200, 83, 0.7); }
}

/* Menu laterale progetto */
.side-menu-project {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: var(--menu-bg);
    box-shadow: var(--menu-shadow);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    overflow-y: auto;
}

.side-menu-project.open {
    left: 0;
}

.project-menu-header {
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--menu-header-bg);
    color: white;
    font-weight: bold;
}

.project-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    transition: transform 0.2s;
}

.project-menu-close:hover {
    transform: scale(1.1);
}

/* Info progetto */
.project-info-box {
    padding: 16px;
    background: white;
    border-bottom: 2px solid var(--menu-border);
}

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--menu-text);
    margin-bottom: 4px;
}

.project-ambiente {
    font-size: 14px;
    color: var(--menu-text-sec);
}

/* Navigazione menu */
.nav-section {
    padding: 8px 0;
}

.nav-title {
    padding: 12px 16px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--menu-text-sec);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: var(--menu-text);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--menu-hover);
    border-left-color: var(--menu-primary);
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    border-left-color: var(--menu-primary);
    color: var(--menu-primary);
    font-weight: 600;
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-item.disabled:hover {
    background: transparent;
    border-left-color: transparent;
}

.nav-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-icon {
    font-size: 20px;
}

/* Submenu Config */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.02);
}

.nav-submenu.open {
    max-height: 500px;
}

.nav-submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 52px;
    color: var(--menu-text);
    cursor: pointer;
    transition: background 0.2s;
}

.nav-submenu-item:hover {
    background: var(--menu-hover);
}

.nav-submenu-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--menu-primary);
    font-weight: 600;
}

/* Indicatori completamento */
.completion-badge {
    display: flex;
    align-items: center;
    gap: 4px;
}

.completion-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.completion-dot.green { background: #22c55e; }
.completion-dot.yellow { background: #eab308; }
.completion-dot.red { background: #ef4444; }

.completion-percent {
    font-size: 11px;
    font-weight: 600;
    color: var(--menu-text-sec);
}

/* Azioni menu */
.menu-actions {
    padding: 16px;
    border-top: 2px solid var(--menu-border);
    background: white;
}

.menu-action-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--menu-border);
    background: white;
    color: var(--menu-text);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-action-btn:hover {
    background: var(--menu-hover);
    border-color: var(--menu-primary);
}

.menu-action-btn.primary {
    background: var(--menu-primary);
    color: white;
    border-color: var(--menu-primary);
}

.menu-action-btn.primary:hover {
    background: #1d4ed8;
}

/* 🆕 v5.739: Pulsante Aggiorna App */
.menu-action-btn.update-app-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-color: #f59e0b;
    font-weight: 600;
    margin-top: 8px;
}
.menu-action-btn.update-app-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: scale(1.02);
}

/* Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ===== MENU PRINCIPALE APPLICAZIONE ===== */
.main-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: var(--menu-bg, #ffffff);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.main-menu.open {
    left: 0;
}

.main-menu-header {
    min-height: 56px;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
}

.main-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    transition: transform 0.2s;
}

.main-menu-close:hover {
    transform: scale(1.1);
}

.main-menu-title {
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* Search Bar */
.main-menu-search {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e5e5;
}

.search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Main Navigation Section */
.main-nav-section {
    flex: 1;
    padding: 8px 0;
}

.main-nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.main-nav-item:hover {
    background: #f5f5f5;
    transform: translateX(5px);
}

.main-nav-item.expandable .main-nav-arrow {
    transition: transform 0.3s;
}

.main-nav-item.expanded .main-nav-arrow {
    transform: rotate(90deg);
}

.main-nav-label {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.main-nav-icon {
    font-size: 20px;
}

.main-nav-arrow {
    margin-left: auto;
    color: #999;
    font-size: 12px;
}

/* Submenu */
.main-submenu {
    max-height: 0;
    overflow: hidden;
    background: #f8f8f8;
    transition: max-height 0.3s ease-out;
}

.main-submenu.open {
    max-height: 300px;
}

.main-submenu-item {
    padding: 12px 20px 12px 52px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.main-submenu-item:hover {
    background: #e8e8e8;
    border-left-color: #667eea;
    color: #333;
}

/* 🆕 v5.740: Stile pulsante Aggiorna App nel menu principale */
.main-submenu-item.update-app-item {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 600;
    margin: 8px 12px;
    border-radius: 8px;
    padding: 12px 20px;
    border-left: none;
}
.main-submenu-item.update-app-item:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: scale(1.02);
}

/* Main Menu Overlay */
.main-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.main-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Quick Actions Bottom */
.main-menu-bottom {
    padding: 16px;
    border-top: 2px solid #e5e5e5;
    background: white;
}

.quick-actions-title {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.quick-actions-grid {
    display: flex;
    gap: 8px;
    justify-content: space-around;
}

.quick-action-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 2px solid #e5e5e5;
    background: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Main content */
.main-content {
    margin-top: 60px;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

/* Responsive */
@media (max-width: 767px) {
    .side-menu-project {
        width: 85%;
        max-width: 320px;
    }
}

@media (min-width: 1024px) {
    .header-actions {
        gap: 12px;
    }
    
    .btn-icon {
        padding: 10px 16px;
    }
}

/* ☁️ FASE 022a: OneDrive Sync UI */
.sync-badge {
    display: inline-block;
    margin-left: auto;
}

/* 🎨 FASE DISEGNI: Badge conteggio */
.count-badge {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.sync-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.sync-settings-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.sync-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.sync-settings-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1e293b;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.sync-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

.sync-options {
    padding: 0 20px;
    margin: 20px 0;
}

.sync-options label {
    display: flex;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    color: #1e293b;
    transition: color 0.2s;
}

.sync-options label:hover {
    color: #2563eb;
}

.sync-options input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sync-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0 20px;
    margin: 20px 0;
}

.btn-sync {
    padding: 10px 16px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-sync:hover {
    background: #f8fafc;
    border-color: #2563eb;
    color: #2563eb;
}

.btn-sync:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #1e40af;
}

.btn-secondary {
    background: white;
    color: #64748b;
    border: 1px solid #cbd5e1;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.sync-info {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
    color: #64748b;
}

.sync-info p {
    margin: 0 0 8px 0;
}

.sync-info strong {
    color: #1e293b;
}

.sync-info ul {
    margin: 8px 0;
}

.sync-info li {
    margin: 6px 0;
}

/* 🆕 Select con larghezza fissa uniforme */
select {
    min-width: 200px;
    width: 100%;
}

/* 🆕 v5.555: Previene auto-zoom iOS su input/select con font piccolo */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MENU SISTEMA - Stili integrati
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Aggiustamenti per compatibilità con menu sistema */
body {
    padding-top: 0;
}

#app {
    transition: margin-left 0.3s ease;
}

/* Nascondi vecchi menu se presenti */
.old-navigation,
.main-menu {
    display: none !important;
}

@media (max-width: 768px) {
    .menu-sistema.active ~ #app {
        margin-left: 0;
    }
}

/* Menu Container */
.menu-sistema {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    transition: left 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
}

.menu-sistema.active {
    left: 0;
}

/* Header */
.menu-header {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.menu-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.menu-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    margin-top: 5px;
}

/* Menu Items */
.menu-items {
    padding: 10px 0;
}

.menu-item {
    position: relative;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 30px;
}

.menu-item.active {
    background: rgba(52, 152, 219, 0.3);
    border-left: 4px solid #3498db;
}

.menu-icon {
    font-size: 20px;
    min-width: 30px;
    text-align: center;
}

.menu-label {
    flex: 1;
    font-size: 16px;
}

.menu-arrow {
    color: rgba(255,255,255,0.5);
    transition: transform 0.3s;
}

.menu-item.expanded .menu-arrow {
    transform: rotate(90deg);
}

/* Submenu */
.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0,0,0,0.2);
}

.submenu.active {
    max-height: 500px;
}

.submenu-item {
    color: rgba(255,255,255,0.9);
    padding: 12px 20px 12px 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.submenu-item:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 70px;
}

/* 🆕 v5.740: Stile pulsante Aggiorna App evidenziato */
.submenu-item.highlight-item {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-weight: 600;
    margin: 8px 12px;
    border-radius: 8px;
    padding: 14px 20px;
}
.submenu-item.highlight-item:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    padding-left: 20px;
    transform: scale(1.02);
}

/* Toggle Button */
.menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: #3498db;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.menu-toggle.active {
    left: 260px;
}

.menu-toggle-icon {
    color: white;
    font-size: 24px;
}

/* Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Footer */
.menu-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sync-status {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sync-status.connected {
    color: #2ecc71;
}
