body { 
    font-family: 'Roboto', sans-serif; 
    background: linear-gradient(135deg, #1A73E8, #D93025);
    background-attachment: fixed;
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh;
    color: white;
}

.header { 
    text-align: center; 
    margin-top: 5vh; 
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-logo {
    max-width: 220px;
    width: 90%;
    height: auto;
    margin: 10px 0;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.secret-lock { 
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 5px; 
    cursor: pointer; 
    transition: transform 0.2s, color 0.2s; 
}

.secret-lock:active { transform: scale(0.9); }
.secret-lock:hover { color: rgba(255, 255, 255, 0.6); }

.header h1 { margin: 0; font-size: 2.2rem; text-shadow: 0 2px 6px rgba(0,0,0,0.4); letter-spacing: 1px; }
.header p { margin-top: 5px; opacity: 0.9; font-weight: 500; letter-spacing: 0.5px; }

.login-bar { 
    background: rgba(255, 255, 255, 0.15); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 25px; 
    border-radius: 16px; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.25); 
    display: flex; 
    gap: 15px; 
    margin-bottom: 30px; 
    flex-wrap: wrap; 
    justify-content: center;
    width: 90%;
    max-width: 800px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-bar input { 
    padding: 14px; 
    border: 1px solid rgba(255, 255, 255, 0.4); 
    border-radius: 8px; 
    outline: none; 
    font-size: 15px; 
    min-width: 200px;
    flex: 1;
    background: rgba(255, 255, 255, 0.95); 
    color: #333;
    transition: box-shadow 0.3s;
}

.login-bar input:focus { box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.5); }

.apps-grid { 
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px; 
    width: 90%;
    max-width: 1100px; 
    padding: 20px; 
    margin-bottom: 5vh;
}

.app-btn { 
    border-radius: 20px; 
    height: 240px; 
    display: flex; 
    flex-direction: column; 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden; 
    border: 1px solid rgba(255,255,255,0.3); 
    padding: 0; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.app-btn:hover { 
    transform: translateY(-12px); 
    box-shadow: 0 20px 40px rgba(0,0,0,0.3); 
    border-color: rgba(255,255,255,0.8);
}

.bg-squadre { background: linear-gradient(145deg, #fd7e14, #d96408); }
.bg-hr { background: linear-gradient(145deg, #20c997, #179b74); }
.bg-magazzino { background: linear-gradient(145deg, #198754, #12653e); }
.bg-telefonia { background: linear-gradient(145deg, #dc3545, #b02a37); }

.app-btn .icon-area { 
    flex: 1; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    color: white; 
    transition: transform 0.3s;
}

.app-btn:hover .icon-area { transform: scale(1.1); }

.app-btn .label-area { 
    height: 65px; 
    color: white; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-weight: bold; 
    font-size: 18px; 
    background: rgba(0,0,0,0.25); 
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.75); align-items: center; justify-content: center; z-index: 999; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal-content { background: white; color: #333; padding: 35px; border-radius: 20px; width: 90%; max-width: 450px; text-align: center; box-shadow: 0 25px 60px rgba(0,0,0,0.6); }

.modal-title-wrap { display: flex; align-items: center; justify-content: center; margin-bottom: 15px; }
.modal-content h3 { margin: 0; font-size: 1.4rem; }
.modal-content p { color: #666; font-size: 14px; margin-bottom: 25px; }
.modal-content input { width: 100%; padding: 14px; margin-bottom: 20px; border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box; outline: none; font-size: 15px; }
.modal-content input:focus { border-color: #1A73E8; }

.action-btn { 
    background: #198754; 
    color: white; 
    border: none; 
    padding: 14px 20px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: bold; 
    width: 100%; 
    transition: all 0.2s; 
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 15px;
    text-transform: uppercase;
}

.icon-margin { margin-right: 8px; }
.action-btn:hover { opacity: 0.9; transform: scale(0.98); }
.action-btn:active { transform: scale(0.95); }
.action-btn.cancel-btn { background: #6c757d; margin-top: 12px; }
.action-btn.sync-btn { background: #0d6efd; width: auto; margin: 0; }
.action-btn.search-btn { width: auto; margin: 0; background: #0d6efd; }
.action-btn.save-btn { margin-top: 20px; }

.perm-search { display: flex; gap: 10px; margin-bottom: 20px; }
.perm-search input { margin-bottom: 0; flex: 1; }

#permSwitches { text-align: left; display: none; flex-direction: column; gap: 15px; background: #f8f9fa; padding: 25px; border-radius: 12px; border: 1px solid #e9ecef; }
#permSwitches label { cursor: pointer; display: flex; align-items: center; gap: 12px; font-weight: 500; color: #444; font-size: 15px; }
#permSwitches input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: #1A73E8; }

#errorMsg { color: white; background: rgba(220, 53, 69, 0.95); padding: 14px 25px; border-radius: 8px; font-weight: bold; margin-bottom: 20px; display: none; box-shadow: 0 6px 15px rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.2); }

@media (max-width: 768px) {
    .login-bar { flex-direction: column; padding: 20px; }
    .login-bar input, .action-btn.sync-btn { width: 100%; }
    .apps-grid { grid-template-columns: 1fr; padding: 10px; gap: 20px; }
    .header h1 { font-size: 1.8rem; }
    .app-btn { height: 180px; }
    .app-btn .icon-area svg { width: 60px; height: 60px; }
    .app-btn .label-area { height: 55px; font-size: 16px; }
}
